a.k. from thus spake a.k.
A few years ago we spent some time implementing a number of the sorting, searching and set manipulation algorithms from the standard C++ library in JavaScript. Since the latter doesn't support the former's abstraction of container access via iterators we were compelled to restrict ourselves to using native
In this post we shall take a look at an algorithm for finding the centrally ranked element, or median, of an array, which is strongly related to the
Array
objects following the conventions of its methods, such as slice
and sort
.In this post we shall take a look at an algorithm for finding the centrally ranked element, or median, of an array, which is strongly related to the
ak.nthElement
function, and then at a particular use for it.