Quick Sort
--Divide and Conquer
--Sorts “in place”
--Very practical with tuning
Divide and Conquer:
1.Divide: Partition array into 2 sub-arrays around pivot x such that elements in lower sub-array <= x <= elements in upper sub-array;
2.Conquer: Recursively sort 2 sub-arrays;
3.Combine: Trivial.
Randomized Quick sort:
--running time is independent of input ordering.
--no assumption about input distribution.
--no specific input elicit the worst-case behavior.
--the worst case determined only by random number generator.