1

I realize this question has been asked a million times before, but I'm hoping this is a little different and a little more interesting. I came across the paper by Dor and Zwick that says it's possible to find the median in an array of n integers in <= 3n comparisons. The paper is here: http://eccc.hpi-web.de/report/1995/031/download

Has anyone ever actually implemented this? It seems very complex and I would enjoy seeing it run to compare it to the more standard versions of the algorithm.

user3270760
  • 1,444
  • 5
  • 23
  • 45
  • I don't see anything in the list of papers that cite Dor–Zwick. I would be very surprised if it were competitive when the comparator wasn't expensive. – David Eisenstat Oct 16 '14 at 15:16
  • I've updated the link to the paper so that it is more easily accessible. There are a lot of proofs and some pseudo-code, but I would really like to see this in a real application. I just want to know if I can find it anywhere. – user3270760 Oct 16 '14 at 16:49
  • Clearly I can't categorically say no, but I doubt it. Complexity-wise, it's a very incremental improvement over the 3n + o(n) algorithm (idea-wise, probably a bigger deal), and anyone motivated by a practical purpose would choose another algorithm (probably introselect). – David Eisenstat Oct 16 '14 at 17:48
  • Is the 3n+o(n) algorithm available anywhere? That sounds very quick and interesting as well. – user3270760 Oct 16 '14 at 17:51
  • 1
    It's due to Schönhage, Paterson, and Pippenger. I can't find an implementation, but it was a [proposed class project](http://cs.umaine.edu/~chaw/cos226/notes/projideas.pdf). – David Eisenstat Oct 16 '14 at 17:57

0 Answers0