|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.core.algo.sorts.ArrayBubbleSort
| Constructor Summary | |
ArrayBubbleSort()
|
|
| Method Summary | |
void |
sort(Sequence S,
Comparator c)
Perform a bubble-sort, assuming atRank(i) is O(1) -- i.e. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ArrayBubbleSort()
| Method Detail |
public void sort(Sequence S,
Comparator c)
'i' is an index indicating the beginning of the sorted part of the sequence, which lets the inner loop break when no more swaps will take place. In the inner loop, elements bubble up, with the maximum taking its place at the tail of the unsorted part of the sequence.
S - c -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||