Tagged in

Programming

Thoughts of a software fundi
Thoughts of a software fundi
Discoveries, lessons learned, things I am working on and other rants
More information
Followers
12
Elsewhere
More, on Medium

Binary Heaps a gentle introduction

Most common use of binary heaps as a backing data structure in implementation of Priority queues, the reason they are better 
is though array backed priority queues have fast access times O(1) they have very slow insert times O(N) because each element of an array needs…


Binary Heap implementation in python

As a follow up to my last article here is the sample implementation of a max heap, that means you will always have a maximum value at the root node. 
With simple changes one can reverse this behavior if required.