Snippets tagged sorting

  • Python's sorted function

    This is an attempt to produce similar behavior as seen in the sorted( ) function in Python. Supporting only one of the three optional arguments. The key - Specifies a function of one argument that is used to extract a comparison key from each list element

    2 people like this

    Posted: 6 years ago by Cameron Frederick

  • Frequency Sort

    Sort a list by a frequency distribution. Frequency is calculated as per a a provided function. In the test case a list of lists is sorted by the frequency of the length of the lists.

    1 people like this

    Posted: 4 years ago by Muigai

  • Incremental (Functional) QuickSort

    Functional quicksort inspired by the Haskell Quick Sort at Since F# lists aren't lazy, uses sequences instead of lists to be haskell like. Roughly O(n) if you Seq.take 1, full on QS if you enumerate the whole thing.

    2 people like this

    Posted: 6 years ago by Tony Lee