public class DoubleHeapSelect
extends java.lang.Object
| Constructor and Description |
|---|
DoubleHeapSelect(double[] heap)
Constructor.
|
DoubleHeapSelect(int k)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double datum)
Assimilate a new value from the stream.
|
double |
get(int i)
Returns the i-th smallest value seen so far.
|
double |
peek()
Returns the k-th smallest value seen so far.
|
void |
sort()
Sort the smallest values.
|
public DoubleHeapSelect(int k)
k - the heap size.public DoubleHeapSelect(double[] heap)
heap - the array to store smallest values to track.public void add(double datum)
public double peek()
public double get(int i)
public void sort()