Return to site

Contoh program pascal quicksort

broken image
broken image

We take the value of the middle element as pivot value, but it can be any value, which is in range of sorted values, even if it doesn't present in the array. AlgorithmThe divide-and-conquer strategy is used in quicksort. The idea of the algorithm is quite simple and once you realize it, you can write quicksort as fast as bubble sort.

broken image

On the average, it has O(n log n) complexity, making quicksort suitable for sorting big data volumes. Quicksort is a fast sorting algorithm, which is used not only for educational purposes, but widely applied in practice. Procedure quicksort(var A:larik aw,ak:integer) Writeln ( 'Hasil data yang telah diurutkan:') Writeln (' PENGURUTAN DENGAN METODE QUICK SORT')

broken image