Divide and Conquer
18 Jan 2014###Features:
- Divide
- Conquer
- Merge
The time complexity for each part varies by different problems.
###Algorithms:
-
K-selection problem(similar to quicksort)
- Select a random element x
- Count how many elements are less than x
- Decide which part of list to search
De-randomize: divide into group of 5, pivot is median of medians
-
FFT
Group even/odd columns together and reduce the computation.
-
K-th smallest in 2 sorted lists
Binary search on 2 lists, knock out 1/4 each time.
-
Find the closest pair in a plane
Your Comments
comments powered by Disqus