Types of Heaps


Priority is a subjective term but can be generally classified as numeric values. In some cases, having a lower value means having a higher priority (like ranks, where rank 1 beats rank 2), while in others, having a higher value may mean having a higher priority (like scores, where a score of 100 beats a score of 50). Depending on what classifies as a high priority, a heap can be categorized into two types.

  • Max heap
  • Min heap

Max heap

Liking the course? Check our discounted plans to continue learning.