10
Binary Trees: The Heap.

Binary Trees: The Heap.

5 years ago
Anonymous $L9wC17otzH

https://towardsdatascience.com/binary-trees-the-heap-381efd4a4611

In 1964, J. Williams the Welsh-born Canadian, developed a structure to find max values. This structure is the heap. The heap is semi-ordered, with the maximum value always at the top.

Let’s say you are in charge of a hospital and there are a number of patients in the waiting room. As each patient waits for the doctor, the patients form a queue. Now imagine a patient is rushed in to the hospital in emergency condition. Should this patient be placed at the end of the queue with the other patients or should the patient be given priority?