Quick Sort
Quick Sort
Divide: Quick Sort divides the array into two sub-arrays based on a chosen
pivot element.
Conquer: the two sub-arrays are recursively sorted.
Ultimately, we get a sorted array.
Time Complexity :
1. O(N*log N)
Occurs with perfect pivot choices leading to equal partitions.
2. O(N2)
Occurs with poor pivot choices leading to highly imbalanced partitions.