Min heap implementation - C++

I have discussed the priority queue and implementations of queue, vector. Now, we are gonna discuss about min heap, also known as a priority queue. So, what’s this data structure? It has 4 main methods: size() - returns the number of the elements front() - return the current minimum element pop() - deletes the current minimum element push(element) - insert new element to the heap How do we implement this?...

October 13, 2023 · 4 min · 839 words · Me