Sorting algorithms/Comb sort: Difference between revisions
Content added Content deleted
(add Ruby) |
m (Move pseudocode to description and remove "implementations" header) |
||
Line 4: | Line 4: | ||
*Combsort with different endings changes to a more efficient sort when the data is almost sorted (when the gap is small). Comb sort with a low gap isn't much better than the Bubble Sort. |
*Combsort with different endings changes to a more efficient sort when the data is almost sorted (when the gap is small). Comb sort with a low gap isn't much better than the Bubble Sort. |
||
Pseudocode: |
|||
= Psuedocode = |
|||
function combsort(array input) |
function combsort(array input) |
||
gap := input.size //initialize gap size |
gap := input.size //initialize gap size |
||
Line 24: | Line 24: | ||
end function |
end function |
||
= Implementations = |
|||
=={{header|C++}}== |
=={{header|C++}}== |
||
This is copied from [[wp:Comb sort|the Wikipedia article]]. |
This is copied from [[wp:Comb sort|the Wikipedia article]]. |