1
00:00:00,420 --> 00:00:01,350
Welcome back.

2
00:00:01,350 --> 00:00:05,880
So we have successfully implemented the priority queue as a min binary heap.

3
00:00:05,880 --> 00:00:11,760
Now over here in this walkthrough just let's look at the differences, uh, with respect to the code

4
00:00:11,760 --> 00:00:15,000
that we have written previously when we implemented the max binary heap.

5
00:00:15,000 --> 00:00:17,760
So over here one difference is that we have a node right.

6
00:00:17,760 --> 00:00:18,570
So we have a node.

7
00:00:18,570 --> 00:00:22,080
So a value and a priority is associated with each node.

8
00:00:22,080 --> 00:00:26,160
And then when we bubble up and bubble down we are not comparing with the value.

9
00:00:26,160 --> 00:00:27,630
We are comparing with the priority.

10
00:00:27,630 --> 00:00:27,840
Right.

11
00:00:27,840 --> 00:00:28,800
So look over here.

12
00:00:28,800 --> 00:00:32,550
We are checking the priority of the element and the parent's priority.

13
00:00:32,550 --> 00:00:34,560
And that's the only difference right.

14
00:00:34,560 --> 00:00:39,060
So again when we dequeue also the function over here looks pretty the same.

15
00:00:39,060 --> 00:00:43,380
But when we bubble down again we are comparing with the priority.

16
00:00:43,380 --> 00:00:46,650
So we have left child dot priority less than element dot priority.

17
00:00:46,650 --> 00:00:51,750
And over here we are checking right child dot priority less than element dot priority or right child

18
00:00:51,750 --> 00:00:54,240
dot priority less than left child dot priority.

19
00:00:54,240 --> 00:00:55,470
So that's the only difference.

20
00:00:55,470 --> 00:00:59,280
So again because it's the same code and the implementation is pretty the same.

21
00:00:59,280 --> 00:01:01,020
We won't go into great detail.

22
00:01:01,020 --> 00:01:05,970
But in the interview yes you have to walk through the code and you can just refer to the walkthrough

23
00:01:05,970 --> 00:01:10,350
where we discussed the code for the max binary heap implementation.
