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: 6 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.
3 people like thisPosted: 2 months ago by Brian Berns
How to enumerate the rational numbers without duplication using a Calkin–Wilf tree.
4 people like thisPosted: 2 months ago by Brian Berns
Basic implementation of the continuation monad with explanation.
3 people like thisPosted: 1 month ago by Brian Berns