Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

meapsoft.MinHeap Class Reference

Inheritance diagram for meapsoft.MinHeap:

Inheritance graph
[legend]
Collaboration diagram for meapsoft.MinHeap:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implementation of a binary min heap.

Author:
Ron Weiss ([email protected])

Definition at line 35 of file MinHeap.java.

Public Methods

 MinHeap ()
 Creates an empty MinHeap.

 MinHeap (Comparator c)
 Use given Comparator for all comparisons between elements in this MinHeap.

 MinHeap (int capacity)
 Creates an empty MinHeap with the given capacity.

 MinHeap (Collection c)
 Create a new MinHeap containing the elements of the given Collection.

Object deleteMin ()
 Delete the smallest element of this MinHeap.

void sort ()
 Perform heap sort on the data stored in this heap.


Constructor & Destructor Documentation

meapsoft.MinHeap.MinHeap Comparator    c [inline]
 

Use given Comparator for all comparisons between elements in this MinHeap.

Otherwise rely on compareTo methods and Comparable Objects.

Definition at line 50 of file MinHeap.java.


Member Function Documentation

void meapsoft.MinHeap.sort   [inline]
 

Perform heap sort on the data stored in this heap.

After calling sort, a call to this objects iterator() method will iterate through the data stored in the heap in sorted order. This is not a stable sort.

Reimplemented from meapsoft.Heap.

Definition at line 86 of file MinHeap.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 6 19:02:30 2007 for MEAPsoft by doxygen1.2.18