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: 11 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: 10 years ago by Muigai

  • Insertion sort

    An tail recursive implementation of insertion sort on list

    0 people like this

    Posted: 8 months ago by tathanhdinh

  • Incremental (Functional) QuickSort

    Functional quicksort inspired by the Haskell Quick Sort at http://www.haskell.org/haskellwiki/Introduction. 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.

    3 people like this

    Posted: 11 years ago by Tony Lee

  • Natural Sort Order

    Sort strings as file managers usually do, treating numeric substrings as numbers.

    2 people like this

    Posted: 3 years ago by Jim Foye