|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.fastutil.doubles.DoubleHeaps
public class DoubleHeaps
A class providing static methods and objects that do useful things with heaps.
The static methods of this class allow to treat arrays as 0-based heaps. They are used in the implementation of heap-based queues, but they may be also used directly.
| Method Summary | |
|---|---|
static int |
downHeap(double[] heap,
int size,
int i,
DoubleComparator c)
Moves the given element down into the heap until it reaches the lowest possible position. |
static void |
makeHeap(double[] heap,
int size,
DoubleComparator c)
Makes an array into a heap. |
static int |
upHeap(double[] heap,
int size,
int i,
DoubleComparator c)
Moves the given element up in the heap until it reaches the highest possible position. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int downHeap(double[] heap,
int size,
int i,
DoubleComparator c)
heap - the heap (starting at 0).size - the number of elements in the heap.i - the index of the element that must be moved down.c - a type-specific comparator, or null for the natural order.
i.
public static int upHeap(double[] heap,
int size,
int i,
DoubleComparator c)
heap - the heap (starting at 0).size - the number of elements in the heap.i - the index of the element that must be moved up.c - a type-specific comparator, or null for the natural order.
i.
public static void makeHeap(double[] heap,
int size,
DoubleComparator c)
heap - the heap (starting at 0).size - the number of elements in the heap.c - a type-specific comparator, or null for the natural order.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||