User Tools

Site Tools


c:compute-execution-time

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
c:compute-execution-time [2024/01/17 01:15] odeftac: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 și 999+        arr[i] = rand() % 1000;  // Random numbers between and 999
     }     }
 } }
  
-// 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(&start, NULL);     gettimeofday(&start, NULL);
  
-    // Executarea algoritmului de sortare+    // Execute the sorting algorithm
     bubbleSort(arr, ARRAY_SIZE);     bubbleSort(arr, ARRAY_SIZE);
  
c/compute-execution-time.1705446933.txt.gz · Last modified: 2024/01/17 01:15 by odefta