Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Visualizing and exploring sorting algorithms in two dimensions.
Don't know about that, this is not efficent but "explains" quicksort in general:
fun <T : Comparable<T>> quickSort(list: List<T>): List<T> = with(list) { if (size < 2) this else { val pivot = first() val (smaller, greater) = drop(1).partition { it <= pivot } quickSort(smaller) + pivot + quickSort(greater) } }
There are no comments on this comment yet.
Don't know about that, this is not efficent but "explains" quicksort in general: