All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jdsl.core.algo.sorts.ListBubbleSort

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

public class ListBubbleSort
extends Object
implements SortObject

Constructor Index

 o ListBubbleSort()

Method Index

 o sort(Sequence, Comparator)
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.

Constructors

 o ListBubbleSort
 public ListBubbleSort()

Methods

 o 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.


All Packages  Class Hierarchy  This Package  Previous  Next  Index