1

I want to apply the median of medians algorithm to a list of 35 elements

3 7 4 6 9 12 11 

4 5 6 8 2 7 11 

23 12 4 7 3 9 8

4 5 6 3 2 1 9 

9 3 4 5 6 1 14

T(n) <= T(n/5) + T(7n/10) + O(n) fails.

Can you explain why?

Jonathan Leffler
  • 666,971
  • 126
  • 813
  • 1,185
karthik
  • 11
  • 5
  • Wikipedia explains it well: http://en.wikipedia.org/wiki/Selection_algorithm#Properties_of_pivot – user541686 Mar 05 '12 at 04:20
  • wikipedia is saying T(n) <= T(n/5) + T(7n/10) + O(n) but which happened to be false when i tried – karthik Mar 05 '12 at 04:41
  • 1
    What do you mean by it "happened to be false"? Also, the following SO question might be helpful (this question is probably a duplicate, but I'm not not sure because I don't know exactly what you mean by "T(n) <= T(n/5) + T(7n/10) + O(n)" fails): http://stackoverflow.com/questions/9489061/understanding-median-of-medians-algorithm – Michael Burr Mar 05 '12 at 04:48
  • 1
    @karthik Show us what you tried. – RaviSharma Mar 05 '12 at 09:42

1 Answers1

0

http://classes.soe.ucsc.edu/cmps102/Spring05/selectAnalysis.pdf

This pdf explains it. Spend some time on it. You will get it. Its easy.

dejavu
  • 3,086
  • 6
  • 29
  • 58