jdsl.core.algo.sorts
Class ListBubbleSort

java.lang.Object
  |
  +--jdsl.core.algo.sorts.ListBubbleSort

public class ListBubbleSort
extends java.lang.Object
implements SortObject


Constructor Summary
ListBubbleSort()
           
 
Method Summary
 void sort(Sequence S, Comparator c)
          Perform a bubble-sort, assuming the sequence is based on a doubly-linked list. First inserts a sentinel to avoid needing to check if we're swapping with the outer loop locator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBubbleSort

public ListBubbleSort()
Method Detail

sort

public void sort(Sequence S,
                 Comparator c)
Perform a bubble-sort, assuming the sequence is based on a doubly-linked list.

First inserts a sentinel to avoid needing to check if we're swapping with the outer loop locator. After that, we can run an analogue of the array-based bubble-sort.

Specified by:
sort in interface SortObject
Parameters:
S -  
c -