public class MaxHeap extends BinaryHeap
elements, size| Modifier and Type | Method and Description |
|---|---|
int |
extractMax()
Time complexity: O(logn)
|
void |
heapify(int i)
Time complexity: O(logn)
|
void |
increaseKey(int i,
int value)
Time complexity: O(logn)
|
void |
insert(int e)
Time complexity: O(logn)
|
int |
max()
Time complexity: Θ(1)
|
public int max()
public int extractMax()
throws java.lang.Exception
java.lang.Exceptionpublic void increaseKey(int i,
int value)
throws java.lang.Exception
java.lang.Exceptionpublic void insert(int e)
insert in class BinaryHeappublic void heapify(int i)
heapify in class BinaryHeap