kiirsorteerimine
Kiirsorteerimine, known in English as Quicksort, is an efficient comparison-based sorting algorithm. Developed by Tony Hoare in 1959, it was published in 1961. Quicksort is widely used for its good average-case performance, typically having a time complexity of O(n log n). Its worst-case time complexity is O(n^2), but this is relatively rare in practice with good pivot selection strategies.
The algorithm operates on the principle of divide and conquer. It partitions an array into two sub-arrays
The choice of pivot significantly impacts the algorithm's performance. Common strategies include selecting the first element,
Quicksort is an in-place sorting algorithm, meaning it requires only a constant amount of additional memory