Class BoundedLongHeap

java.lang.Object
io.github.jbellis.jvector.util.AbstractLongHeap
io.github.jbellis.jvector.util.BoundedLongHeap

public class BoundedLongHeap extends AbstractLongHeap
An AbstractLongHeap with a fixed maximum size, allocated at construction time.
  • Constructor Details

    • BoundedLongHeap

      public BoundedLongHeap(int maxSize)
      Create an empty Heap of the configured initial size.
      Parameters:
      maxSize - the maximum size of the heap
    • BoundedLongHeap

      public BoundedLongHeap(int initialSize, int maxSize)
  • Method Details

    • push

      public boolean push(long value)
      Description copied from class: AbstractLongHeap
      Adds a value to an LongHeap in log(size) time.
      Specified by:
      push in class AbstractLongHeap
      Returns:
      true if the new value was added. (A fixed-size heap will not add the new value if it is full, and the new value is worse than the existing ones.)