TheAlgorithms / Kotlin

All Algorithms implemented in Kotlin
MIT License
1.44k stars 375 forks source link

Binary heap (min/max heap) implementation with tests #87

Open AntonMinko opened 2 years ago

AntonMinko commented 2 years ago

Standard binary heap implementation with the following methods:

  1. Push
  2. Pop
  3. Peek
  4. Heapify Tests demonstrate how to instantiate a minHeap and MaxHeap.