Quick Sort algorithm:
- is one of the most efficient sorting algorithms.
- is based on divide and conquer approach.
- Successively divides the problem into smaller parts until the problem become so small that they can be directly solved.
In quick sort algorithm, you:
- Select an element from the list called as pivot.
- Partition the list into 2 parts such that:
- All the elements towards the left end of the list are smaller than the pivot.
- All the elements towards the right end of the list are greater than the pivot.
You repeat this process for each of the two sublists created after partitioning. This process continues untill one element is left in each sublist.