/HeapTree

Generic Heap Tree in Java. It can be used as Max Heap or Min Heap.

Primary LanguageJavaMIT LicenseMIT

#Heap Tree

This project implements a Generic Heap Tree in Java that can be used as a Max Heap or Min Heap.

Methods:

  • Put: adds a new element into the tree sorting it.
  • Top: returns the element on the root (max or min).
  • Extract: top method but removing the element (destructive read).

The tree starts with an initial dimension for 100 nodes. Each time the tree becomes 90% full, the data structure is resized so it can store a higher quantity of elements.