Documentation of 'Catalano.Core.Structs.BinaryHeap' Java class
BinaryHeap
Catalano.Core.Structs

Class BinaryHeap<E extends java.lang.Comparable<E>>

  • Type Parameters:
    E - Item.


    public class BinaryHeap<E extends java.lang.Comparable<E>>
    extends java.lang.Object
    Binary Heap.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BinaryHeap()
      Initializes a new instance of the BinaryHeap class.
      BinaryHeap(E[] keys)
      Initializes a new instance of the BinaryHeap class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(E node)
      Adds an item in the heap.
      int count()
      Get the count actually in the heap.
      boolean isEmpty()
      Check if the heap is empty.
      E min()
      Get the minimum item from the heap.
      E remove()
      Remove the last node from the heap.
      void remove(E item)
      Remove a specified item from the heap.
      int size()
      Get the size of the heap.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BinaryHeap

        public BinaryHeap()
        Initializes a new instance of the BinaryHeap class.
      • BinaryHeap

        public BinaryHeap(E[] keys)
        Initializes a new instance of the BinaryHeap class.
        Parameters:
        keys - Items.
    • Method Detail

      • count

        public int count()
        Get the count actually in the heap.
        Returns:
        Count.
      • size

        public int size()
        Get the size of the heap.
        Returns:
        Size.
      • add

        public void add(E node)
        Adds an item in the heap.
        Parameters:
        node - Item as node.
      • remove

        public E remove()
        Remove the last node from the heap.
        Returns:
        Item from the last node.
      • remove

        public void remove(E item)
        Remove a specified item from the heap.
        Parameters:
        item - Item.
      • min

        public E min()
        Get the minimum item from the heap.
        Returns:
        Item.
      • isEmpty

        public boolean isEmpty()
        Check if the heap is empty.
        Returns:
        True if the heap is empty, otherwise false.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.