DataStructures
Class DSL

java.lang.Object
  |
  +--DataStructures.DSL

public class DSL
extends java.lang.Object

Implements a deterministic skip list. Note that all "matching" is based on the compareTo method.


Constructor Summary
DSL(Comparable inf)
          Construct the DSL.
 
Method Summary
 Comparable find(Comparable x)
          Find an item in the DSL.
 Comparable findMax()
          Find the largest item in the DSL.
 Comparable findMin()
          Find the smallest item in the DSL.
 void insert(Comparable x)
          Insert into the DSL.
 boolean isEmpty()
          Test if the DSL is logically empty.
static void main(java.lang.String[] args)
           
 void makeEmpty()
          Make the DSL logically empty.
 void remove(Comparable x)
          Remove from the DSL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSL

public DSL(Comparable inf)
Construct the DSL.
Parameters:
inf - the largest Comparable.
Method Detail

insert

public void insert(Comparable x)
Insert into the DSL.
Parameters:
x - the item to insert.

remove

public void remove(Comparable x)
Remove from the DSL. Unimplemented.
Parameters:
x - the item to remove.

findMin

public Comparable findMin()
Find the smallest item in the DSL.
Returns:
smallest item, or null if empty.

findMax

public Comparable findMax()
Find the largest item in the DSL.
Returns:
the largest item, or null if empty.

find

public Comparable find(Comparable x)
Find an item in the DSL.
Parameters:
x - the item to search for.
Returns:
the matching item, or null if not found.

makeEmpty

public void makeEmpty()
Make the DSL logically empty.

isEmpty

public boolean isEmpty()
Test if the DSL is logically empty.
Returns:
true if empty, false otherwise.

main

public static void main(java.lang.String[] args)