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: 8 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: 4 months ago by Brian Berns
Calculate triangle numbers in the most inefficient way possible!
3 people like thisPosted: 1 month ago by Brian Berns
How to enumerate the rational numbers without duplication using a Calkin–Wilf tree.
4 people like thisPosted: 4 months ago by Brian Berns
Basic implementation of the continuation monad with explanation.
3 people like thisPosted: 3 months ago by Brian Berns
Describes a function called "fix" that can be used to generate recursive functions from non-recursive functions, with some simple examples.
5 people like thisPosted: 27 days ago by Brian Berns