Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are some links to sorting algorithms implemented in Haskell:</p> <ul> <li><a href="https://en.wikipedia.org/wiki/Quicksort" rel="nofollow noreferrer" title="Quicksort">Quicksort</a></li> <li><a href="https://en.wikipedia.org/wiki/Insertion_sort" rel="nofollow noreferrer" title="Insertion sort">Insertion sort</a></li> <li><a href="https://en.wikipedia.org/wiki/Merge_sort" rel="nofollow noreferrer" title="Merge sort">Merge sort</a></li> <li><a href="https://en.wikipedia.org/wiki/Selection_sort" rel="nofollow noreferrer" title="Selection sort">Selection sort</a></li> <li><a href="https://en.wikipedia.org/wiki/Counting_sort" rel="nofollow noreferrer" title="Counting sort">Counting sort</a></li> </ul> <p>Merge sort is often the best choice for sorting linked lists. Functional languages usually operates on lists although I have little knowledge on how most functional languages implements lists. In Common Lisp they are implemented as linked lists and I presume most functional languages do as well. </p> <p>While quicksort can be written for linked lists it will suffer from poor pivot selection because of random access. While this does not matter on completely random input, on partially or completely sorted input pivot selection becomes very important. Other sorting algorithms may also suffer from the slow random-access performance of linked lists. </p> <p>Merge sort on the other hand works well with linked lists and it is possible to implement the algorithm such that it only requires some constant of extra space with linked lists.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload