DSL - package DataStructures; / / / / / / / / / / / /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
package DataStructures; // BinarySearchTree class // // CONSTRUCTION: with a value at least as large as all others // // ******************PUBLIC OPERATIONS********************* // void insert( x ) --> Insert x // void remove( x ) --> Remove x (unimplemented) // Comparable find( x ) --> Return item that matches x // Comparable findMin( ) --> Return smallest item // Comparable findMax( ) --> Return largest item // boolean isEmpty( ) --> Return true if empty; else false // void makeEmpty( ) --> Remove all items /** * Implements a deterministic skip list. * Note that all "matching" is based on the compareTo method. * @author Mark Allen Weiss */ public class DSL { /** * Construct the DSL. * @param inf the largest Comparable. */ public DSL( Comparable inf ) { infinity = inf; bottom = new SkipNode( null ); bottom.right = bottom.down = bottom; tail = new SkipNode( infinity ); tail.right = tail; header = new SkipNode( infinity, tail, bottom ); } /** * Insert into the DSL. * @param x the item to insert. */ public void insert( Comparable x )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/22/2011 for the course CSC 532 taught by Professor Dr.gursaranadhar during the Spring '07 term at University of North Carolina Wilmington.

Page1 / 4

DSL - package DataStructures; / / / / / / / / / / / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online