c:compute-execution-time
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
c:compute-execution-time [2024/01/17 01:15] – odefta | c:compute-execution-time [2024/01/17 01:16] (current) – odefta | ||
---|---|---|---|
Line 35: | Line 35: | ||
#define ARRAY_SIZE 10000 | #define ARRAY_SIZE 10000 | ||
- | // Functie pentru bubble sort | ||
void bubbleSort(int arr[], int n) { | void bubbleSort(int arr[], int n) { | ||
int i, j, temp; | int i, j, temp; | ||
Line 49: | Line 48: | ||
} | } | ||
- | // Functie pentru a umple array-ul cu valori aleatoare | ||
void fillArray(int arr[], int n) { | void fillArray(int arr[], int n) { | ||
for (int i = 0; i < n; i++) { | for (int i = 0; i < n; i++) { | ||
- | arr[i] = rand() % 1000; // Numere aleatoare între | + | arr[i] = rand() % 1000; // Random numbers between |
} | } | ||
} | } | ||
- | // Functie pentru afisarea array-ului | ||
void printArray(int arr[], int n) { | void printArray(int arr[], int n) { | ||
for (int i = 0; i < n; i++) { | for (int i = 0; i < n; i++) { | ||
Line 73: | Line 70: | ||
gettimeofday(& | gettimeofday(& | ||
- | // Executarea algoritmului de sortare | + | // Execute the sorting algorithm |
bubbleSort(arr, | bubbleSort(arr, | ||
c/compute-execution-time.1705446933.txt.gz · Last modified: 2024/01/17 01:15 by odefta