Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

meapsoft.MaxHeap Class Reference

Inheritance diagram for meapsoft.MaxHeap:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Implementation of a binary max heap.

Author:
Ron Weiss (ronw@ee.columbia.edu)

Definition at line 38 of file MaxHeap.java.

Public Methods

 MaxHeap ()
 Creates an empty MaxHeap.

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

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

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

Object deleteMax ()
 Delete the largest element of this MaxHeap.


Protected Methods

int cmp (int node1, int node2)
 Compare two Objects in this heap - wrapper around compareTo/Comparator.compare.


Constructor & Destructor Documentation

meapsoft.MaxHeap.MaxHeap Comparator    c [inline]
 

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

Otherwise rely on compareTo methods and Comparable Objects.

Definition at line 53 of file MaxHeap.java.


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