Welcome back.
So we have successfully implemented the priority queue as a min binary heap.
Now over here in this walkthrough just let's look at the differences, uh, with respect to the code
that we have written previously when we implemented the max binary heap.
So over here one difference is that we have a node right.
So we have a node.
So a value and a priority is associated with each node.
And then when we bubble up and bubble down we are not comparing with the value.
We are comparing with the priority.
Right.
So look over here.
We are checking the priority of the element and the parent's priority.
And that's the only difference right.
So again when we dequeue also the function over here looks pretty the same.
But when we bubble down again we are comparing with the priority.
So we have left child dot priority less than element dot priority.
And over here we are checking right child dot priority less than element dot priority or right child
dot priority less than left child dot priority.
So that's the only difference.
So again because it's the same code and the implementation is pretty the same.
We won't go into great detail.
But in the interview yes you have to walk through the code and you can just refer to the walkthrough
where we discussed the code for the max binary heap implementation.