edu.olemiss.cs211
Class MinHeap<T extends java.lang.Comparable<T>>

java.lang.Object
  extended by edu.olemiss.cs211.MinHeap<T>
Type Parameters:
T -

public class MinHeap<T extends java.lang.Comparable<T>>
extends java.lang.Object

Min heap implementation


Constructor Summary
MinHeap()
           
 
Method Summary
 void add(T element)
          method to insert element into heap
 T remove()
          method to remove the root node ,heapify the tree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinHeap

public MinHeap()
Method Detail

add

public void add(T element)
method to insert element into heap

Parameters:
element -

remove

public T remove()
method to remove the root node ,heapify the tree

Returns:
the removed node's (root's) value