Home | Trees | Index | Help |
|
---|
Package nltk_lite :: Package misc :: Module sort |
|
Function Summary | |
---|---|
Bubble Sort: compare adjacent elements of the list left-to-right, and swap them if they are out of order. | |
demo()
| |
Merge Sort: split the list in half, and sort each half, then combine the sorted halves. | |
quick(a)
| |
Selection Sort: scan the list to find its smallest element, then swap it with the first element. |
Function Details |
---|
bubble(a)Bubble Sort: compare adjacent elements of the list left-to-right, and swap them if they are out of order. After one pass through the list swapping adjacent items, the largest item will be in the rightmost position. The remainder is one element smaller; apply the same method to this list, and so on. |
merge(a)Merge Sort: split the list in half, and sort each half, then combine the sorted halves. |
selection(a)Selection Sort: scan the list to find its smallest element, then swap it with the first element. The remainder of the list is one element smaller; apply the same method to this list, and so on. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Tue Sep 5 09:37:22 2006 | http://epydoc.sf.net |