com.mhhe.clrs2e
Class SortableSentinelDLL

java.lang.Object
  |
  +--com.mhhe.clrs2e.LinkedList
        |
        +--com.mhhe.clrs2e.SentinelDLL
              |
              +--com.mhhe.clrs2e.SentinelDLLDictionary
                    |
                    +--com.mhhe.clrs2e.SortableSentinelDLL
All Implemented Interfaces:
Dictionary

public class SortableSentinelDLL
extends SentinelDLLDictionary
implements Dictionary

Circular, doubly linked list with a sentinel, that also has a sort method. Uses insertion sort, but directly on the linked list.


Nested Class Summary
 
Nested classes inherited from class com.mhhe.clrs2e.SentinelDLL
SentinelDLL.SentinelDLLIterator
 
Nested classes inherited from class com.mhhe.clrs2e.LinkedList
LinkedList.ListIterator, LinkedList.Node
 
Field Summary
 
Fields inherited from class com.mhhe.clrs2e.SentinelDLL
nil
 
Constructor Summary
SortableSentinelDLL()
           
 
Method Summary
 void sort()
          Runs insertion sort on a circular, doubly linked list with a sentinel.
 
Methods inherited from class com.mhhe.clrs2e.SentinelDLLDictionary
insert, insert, insertAfter, insertAtTail, search
 
Methods inherited from class com.mhhe.clrs2e.SentinelDLL
concatenate, delete, isEmpty, iterator
 
Methods inherited from class com.mhhe.clrs2e.LinkedList
dereference, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mhhe.clrs2e.Dictionary
delete, insert, search
 

Constructor Detail

SortableSentinelDLL

public SortableSentinelDLL()
Method Detail

sort

public void sort()
Runs insertion sort on a circular, doubly linked list with a sentinel.

Throws:
java.lang.ClassCastException - if the objects in the list do not implement the Comparable interface.