Functional Pearl No.2 – The Max Number of Surpassers (typeocaml.com) 22 points by jacksontale 11y ago ↗ HN
[–] pronoiac 11y ago ↗ If we're targeting O(n log n), we could just sort the array and examine the number of times the minimum entry appears. [–] dcre 11y ago ↗ The answer is not always the lowest number, e.g., if it appears late in the list. [–] pronoiac 11y ago ↗ Ah! I missed the "whose indices are bigger" item in the description. [–] oltmang 11y ago ↗ Crap, me too! It also would've helped if he provided an example where the answer wasn't also the min. [–] jacksontale 11y ago ↗ Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.
[–] dcre 11y ago ↗ The answer is not always the lowest number, e.g., if it appears late in the list. [–] pronoiac 11y ago ↗ Ah! I missed the "whose indices are bigger" item in the description. [–] oltmang 11y ago ↗ Crap, me too! It also would've helped if he provided an example where the answer wasn't also the min. [–] jacksontale 11y ago ↗ Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.
[–] pronoiac 11y ago ↗ Ah! I missed the "whose indices are bigger" item in the description. [–] oltmang 11y ago ↗ Crap, me too! It also would've helped if he provided an example where the answer wasn't also the min. [–] jacksontale 11y ago ↗ Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.
[–] oltmang 11y ago ↗ Crap, me too! It also would've helped if he provided an example where the answer wasn't also the min. [–] jacksontale 11y ago ↗ Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.
[–] jacksontale 11y ago ↗ Yeah, you are right, the example number list in the post was not that awesome. If I am free at any time, i will modify the example. Just refining the diagram will be quite painful.
[–] tel 11y ago ↗ If you like this then you should check out the source, Richard Bird's book [0] for it and many other similar examples.[0] http://www.amazon.com/Pearls-Functional-Algorithm-Design-Ric... [–] jacksontale 11y ago ↗ Yeah, I formally introduced the book when I presented the pearl 1: http://typeocaml.com/2015/02/02/functional-pearl-no-1-the-mi...
[–] jacksontale 11y ago ↗ Yeah, I formally introduced the book when I presented the pearl 1: http://typeocaml.com/2015/02/02/functional-pearl-no-1-the-mi...
8 comments
[ 2.5 ms ] story [ 31.5 ms ] thread[0] http://www.amazon.com/Pearls-Functional-Algorithm-Design-Ric...