This method is described in Knuth's Art of Programming, Volume 3, Page 212. See https://stackoverflow.com/questions/4956593/optimal-algorithm-for-returning-top-k-values-from-an-array-of-length-n This isn't the fastest possible implementation, but it is pure functional code (no mutation).
0 people like thisPosted: 4 months ago by Brian Berns
It is well known that it is impossible to define equality between arbitrary functions. However, there is a large class of functions for which we can determine equality, and it’s strange and surprising. We explore this idea using F# code translated from the Swift programming language.
2 people like thisPosted: 5 days ago by Brian Berns
How to enumerate the rational numbers without duplication using a Calkin–Wilf tree.
4 people like thisPosted: 19 days ago by Brian Berns