A good linear algorithm for finding the kth order statistic is found on many websites, it is too long for me to recopy, so here is a site:
http://www.cs.uiowa.edu/~jjkari/44_03/median.pdf
I have used this algorithm (or a variation of it) and it works pretty well.
Denise
I'm writing a program that analyzes several algorithms and need to find out how much memory is used and how much real-time has elapsed. Can I just use sbrk(0) before and after each algorithm to analyze the memory usage? Does anybody have any suggestions for the elapsed real-time usage? I can...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.