CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 14:13:14 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=19dc0687f9dab26e60d2780db22e0fc438f7436827e337c3f7d95e993a98765fa%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22WJ36J57tSrE0nflQUIkijbFBDwfHs7gH%22%3B%7D; HttpOnly; Path=/
cf-ray: 98df6fb8bf36c181-BLR
Algoritmi lezione 15 - Insertion Sort, parte 1/2 - Pastebin.com
SHARE
TWEET

Algoritmi lezione 15 - Insertion Sort, parte 1/2
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <chrono>
- #include <ctime>
- #include <random>
- using namespace std;
- #include "../../min_max/utility_vettori.h"
- using namespace std;
- void insertion_sort_interi(unsigned long v[], int numero_elementi)
- {
- for (int i = 1; i < numero_elementi; i++) {
- int elemento_corrente = v[i];
- int j = i - 1;
- while( j>=0 && v[j] > elemento_corrente)
- {
- v[j + 1] = v[j];
- j--;
- }
- v[j + 1] = elemento_corrente;
- }
- }
- const int QUANTI_ELEMENTI = 50000;
- const int LUNGHEZZA = 1000;
- unsigned long v[QUANTI_ELEMENTI];
- int main()
- {
- carica_vettore_interi(v, QUANTI_ELEMENTI);
- //lo ordino decrescente
- // ordina_vettore_interi_senza_segno(v, QUANTI_ELEMENTI, false);
- Cronometro(Stato::START);
- //lo ordino crescente
- insertion_sort_interi(v, QUANTI_ELEMENTI);
- cout << "Tempo impiegato: " << Cronometro(Stato::STOP) << endl;
- if (verifica_ordine_crescente(v, QUANTI_ELEMENTI)) cout <<"IN ORDINE!\n";
- //stampa_vettore_interi(v, QUANTI_ELEMENTI);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
β
Marketplace Glitch β
Working NEVER SEEN BE...
JavaScript | 1 sec ago | 0.25 KB
-
π ChangeNOW Exploit
JavaScript | 9 sec ago | 0.24 KB
-
ββ
Exploit 2500$ in 15 Minutesβββ H
JavaScript | 10 sec ago | 0.25 KB
-
π EASY MONEY GUIDE β
Working R
JavaScript | 18 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 20 sec ago | 0.24 KB
-
π Instant BTC Profit Method β
Working E
JavaScript | 27 sec ago | 0.25 KB
-
π¨ Free Crypto Method π¨
JavaScript | 30 sec ago | 0.24 KB
-
β
Make $2500 in 20 minutesβ X
JavaScript | 36 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand