# Why And When To Use Binary Heaps

There are 2 main reasons to use a Binary Heap, which was created by J.W. J. Williams in 1964 for heapsort.

# Why Use Binary Heaps ?

1. For instant access to the largest value in the case of a Max Heap or the smallest value in the case of a Min Heap. By “instant access” I mean constant time or O(1) for you computer scientists. This just means that we know where the value will be which is in the root of the tree or at the start of the array, depending on which data structure you are using.
2. Useful for priority queues or schedulers, where the earliest item is desired. A practical application for this may be prioritizing patients at a hospital to work on with the highest priority

If you would like to learn more about computer science and Algorithm Analysis , you can take my online course here. I also have a course on Udemy.com called Recurrence Relation Made Easy where I help students to understand how to solve recurrence relations and asymptotic terms such as Big-O, Big Omega, and Theta. You can check out my YouTube channel of videos where I solve recurrence relations and perform algorithm analysis on code that anyone can check out for free !

Thanks for reading this article I hope its helpful to you all ! Keep up the learning, and if you would like more computer science, programming and algorithm analysis videos please visit and subscribe to my YouTube channels (randerson112358 & compsci112358 )

# Check out the following for content / videos on Computer Science, Algorithm Analysis, Programming and Logic:

compsci112358:

Video Tutorials on Recurrence Relation:

Video Tutorial on Algorithm Analysis:
https://www.udemy.com/algorithm-analysis/

Written by