#1024
QuickSort
Se dă un șir cu n
elemente, numere întregi. Folosind metoda QuickSort, ordonați crescător elementele acestui șir.
Problema | QuickSort | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47197686 | Utilizator | |
Fișier | quicksort.cpp | Dimensiune | 2.09 KB |
Data încărcării | 05 Decembrie 2023, 22:47 | Scor / rezultat | Eroare de compilare |
quicksort.cpp: In function 'void BinaryInsertionSort(int*, int, int)': quicksort.cpp:12:7: error: 'opA' was not declared in this scope opA+=1;//Assignment ^ quicksort.cpp:17:12: error: 'opC' was not declared in this scope opC+=1;//Comparison ^ quicksort.cpp:6:9: warning: unused variable 'ind' [-Wunused-variable] int ind; ^ quicksort.cpp:7:9: warning: unused variable 'aux' [-Wunused-variable] int aux,elem,low,high,mid; ^ quicksort.cpp: In function 'int Partition(int*, int, int)': quicksort.cpp:38:7: error: 'opC' was not declared in this scope opC+=1;//Comparison ^ quicksort.cpp:57:11: error: 'opA' was not declared in this scope opA+=3;//Assignment ^ quicksort.cpp:64:3: error: 'opA' was not declared in this scope opA+=3;//Assignment ^ quicksort.cpp: In function 'void HybridQuickSortBinaryInsertionSort(int*, int, int, int)': quicksort.cpp:77:14: error: 'opA' was not declared in this scope opA+=3;//Assignment ^ quicksort.cpp:79:38: error: 'QuickSort' was not declared in this scope QuickSort(arr, low, p - 1); ^ quicksort.cpp: In function 'int main()': quicksort.cpp:93:46: error: 'N' was not declared in this scope HybridQuickSortBinaryInsertionSort(arr,0,N-1,19); ^ quicksort.cpp:91:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&arr[i]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema QuickSort face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.