1
00:00:01,110 --> 00:00:08,820
All right, so I want to introduce a new data structure that I really like, and this is called a heap.

2
00:00:08,970 --> 00:00:13,050
So we're going to talk about heaps now and we'll have a few lectures on them.

3
00:00:13,960 --> 00:00:21,330
They're really cool, pretty simple data structure that can do some really interesting things.

4
00:00:21,780 --> 00:00:22,830
So let's get into it.

5
00:00:24,410 --> 00:00:25,430
So what is the heat?

6
00:00:25,460 --> 00:00:29,480
Well, it's similar to looking to a binary search tree.

7
00:00:29,960 --> 00:00:36,020
If we're just talking about the things that we've seen so far in the course, so it's the same looking

8
00:00:36,020 --> 00:00:39,620
in theory, but not necessarily implemented in the same way.

9
00:00:40,220 --> 00:00:46,100
And it's also not necessarily used for the same type of operations as a binary search tree.

10
00:00:46,880 --> 00:00:49,220
So let's talk about the defining characteristics of a heat.

11
00:00:50,350 --> 00:00:58,690
So structurally, a heap has to be a perfect binary tree up to at least, but not including the last

12
00:00:58,690 --> 00:00:59,110
level.

13
00:00:59,800 --> 00:01:05,560
What that means is like if you look at this picture right here, let's start up here and kind of encompass

14
00:01:05,560 --> 00:01:08,330
this entire area, not including the last level, right?

15
00:01:08,350 --> 00:01:13,930
So let's go here and all the way over here, I'm trying to draw in a circle around the part that would

16
00:01:13,930 --> 00:01:15,850
be a perfect binary tree.

17
00:01:17,010 --> 00:01:18,450
So let's take a look at that.

18
00:01:19,140 --> 00:01:25,650
Each level actually has double the notes of what the parent level has, so we start at the root and

19
00:01:25,650 --> 00:01:29,430
look at the level below the we noticed that the route has one node, right?

20
00:01:30,090 --> 00:01:31,950
The level below it has two nodes.

21
00:01:32,370 --> 00:01:35,190
The level below that node has four nodes.

22
00:01:35,910 --> 00:01:42,330
The level below that node has eight right one two three four five six seven eight.

23
00:01:43,930 --> 00:01:48,010
So if you think about it, it's kind of like if you start the level zero.

24
00:01:49,130 --> 00:01:55,190
Each level that you go down is basically two to the power of the level, so it's consecutive powers

25
00:01:55,190 --> 00:01:55,670
of two.

26
00:01:56,150 --> 00:01:58,220
So two to the zero is one.

27
00:01:58,790 --> 00:02:08,330
The next level two to the one is to the next level, two to the two is for two to the three is eight.

28
00:02:08,330 --> 00:02:11,840
And if we filled out this whole level, it would be 16, right?

29
00:02:12,230 --> 00:02:15,980
The last level, we do not have to have completely filled out.

30
00:02:16,160 --> 00:02:23,630
But another important property of a heap like structurally is that the heat must be built from left

31
00:02:23,630 --> 00:02:24,200
to right.

32
00:02:24,770 --> 00:02:29,270
So when we build the heap, we actually have to like, let's say we're starting at the root.

33
00:02:30,020 --> 00:02:36,110
We have to fill a left node first before the right node and so on.

34
00:02:37,100 --> 00:02:40,600
So we kind of go down into the right, starting from the left right.

35
00:02:40,610 --> 00:02:46,640
So if we just had one node and we wanted to add another node, we'd have to add this one first and then

36
00:02:46,640 --> 00:02:47,780
we'd have to add that one.

37
00:02:48,230 --> 00:02:52,460
And then we have to have this one and this one and then that one and that one and then kind of fell

38
00:02:52,460 --> 00:02:53,480
into levels like this.

39
00:02:53,480 --> 00:02:55,970
And you notice that's kind of what's happening on the bottom level.

40
00:02:55,970 --> 00:03:01,640
So it's fine that there's like not nodes here like this missing nodes here on this level.

41
00:03:02,510 --> 00:03:08,330
But we could not, for example, let's say we didn't have these two nodes here and we had these nodes

42
00:03:08,330 --> 00:03:08,550
here.

43
00:03:08,570 --> 00:03:09,440
That's not OK.

44
00:03:09,680 --> 00:03:15,650
We would have to fill these two nodes before we could do these two and before we can do these two and

45
00:03:15,650 --> 00:03:16,700
so on and so forth.

46
00:03:18,040 --> 00:03:25,450
So another thing is if the heap is a men heap, every parent node, but must be less than or equal to

47
00:03:25,450 --> 00:03:31,130
each of its children if the parent isn't, if he was a max heaped in the opposite has to be true.

48
00:03:31,150 --> 00:03:41,300
So a heap is really only concerned with whether the parent is less than or greater than the children.

49
00:03:41,320 --> 00:03:41,680
Right?

50
00:03:42,340 --> 00:03:47,260
And in binary search tree, we kind of had like, let's take an example here.

51
00:03:47,260 --> 00:03:54,370
So if we had like five year at the root node, if we got the number three, we would want to put it

52
00:03:54,370 --> 00:03:55,390
on the left right.

53
00:03:56,530 --> 00:04:01,470
If we got the number seven, we would want to put it on the right, right.

54
00:04:01,480 --> 00:04:08,710
So like everything to the right of the root node we're considering would be greater than its value,

55
00:04:08,740 --> 00:04:09,040
right?

56
00:04:09,070 --> 00:04:10,750
Everything in the left would be less then.

57
00:04:11,260 --> 00:04:12,840
So the heap isn't really about that.

58
00:04:12,850 --> 00:04:18,430
The heap is about just having the stuff below these be less than it.

59
00:04:18,430 --> 00:04:18,820
So.

60
00:04:19,240 --> 00:04:22,390
And we're always going to build it from left to right, no matter what.

61
00:04:23,730 --> 00:04:25,950
So what would happen is basically.

62
00:04:27,440 --> 00:04:31,370
You know, we just need to make sure that when you're.

63
00:04:32,800 --> 00:04:39,130
When you have a heap like, for example, this route right here has to be greater than the left child

64
00:04:39,130 --> 00:04:42,310
and greater than the right child if it's a max heap.

65
00:04:42,610 --> 00:04:49,840
If it's a men heave, this route right here has to be less than the left child and less than the right

66
00:04:49,840 --> 00:04:50,200
child.

67
00:04:50,200 --> 00:04:51,400
So that's what we're talking about.

68
00:04:53,310 --> 00:04:55,470
So let's take a look at a mini example.

69
00:04:56,160 --> 00:05:02,640
So you notice here that five is less than 25 and less than 21.

70
00:05:04,330 --> 00:05:13,720
In fact, five is less than everything, and it's sub trees here, right, because at each level, the

71
00:05:13,720 --> 00:05:17,110
things below it have to be greater than right.

72
00:05:17,140 --> 00:05:23,860
So 25, everything below 25 is greater than greater than 25, right?

73
00:05:24,450 --> 00:05:28,000
So you notice like twenty four to forty one, all these numbers are greater.

74
00:05:28,000 --> 00:05:28,840
Twenty seven.

75
00:05:29,860 --> 00:05:32,560
So that property has to be maintained.

76
00:05:35,650 --> 00:05:43,540
So let's go ahead and watch this part of this -- get built so you can better understand how it works

77
00:05:43,540 --> 00:05:47,860
as far as building a house structurally, what we were talking about, you know, coming from left and

78
00:05:47,860 --> 00:05:48,640
going to the right.

79
00:05:50,080 --> 00:05:53,200
So we're just going to start at this point where it's partially completed.

80
00:05:53,500 --> 00:05:55,930
And let's just say that we insert 48.

81
00:05:57,040 --> 00:05:58,750
We're going to put 48 right here.

82
00:06:00,690 --> 00:06:02,730
Forty two would go right here.

83
00:06:03,090 --> 00:06:04,770
Forty one would go right here.

84
00:06:05,580 --> 00:06:08,280
Fifty two right there, 69 right there.

85
00:06:08,430 --> 00:06:10,770
Seventy seven seventy one.

86
00:06:10,780 --> 00:06:12,520
You notice this just doesn't really matter.

87
00:06:12,540 --> 00:06:15,780
We're just it doesn't really matter what the values are in this situation.

88
00:06:16,260 --> 00:06:18,870
We're just building it out from left to right.

89
00:06:18,880 --> 00:06:23,610
So that's the purpose of showing this, you know, is that you have to build it out like this.

90
00:06:25,640 --> 00:06:26,030
Right.

91
00:06:27,470 --> 00:06:33,100
So unfortunately, though, incoming data is not always going to arrive in a perfect order like that,

92
00:06:33,110 --> 00:06:37,190
you notice that this just like if we're going back, you can see us just building perfectly.

93
00:06:37,370 --> 00:06:44,180
We just we just so happen to be getting all these values that are greater than the parent.

94
00:06:44,210 --> 00:06:46,250
We care about it being a men heap, right?

95
00:06:46,260 --> 00:06:50,030
So they're supposed to be greater than the parent, but we just keep getting like perfect values that

96
00:06:50,030 --> 00:06:52,130
are always like 52 is greater than that.

97
00:06:52,730 --> 00:06:54,500
Oh, in 69 next.

98
00:06:54,500 --> 00:06:56,800
That's great because it's bigger than that.

99
00:06:56,810 --> 00:06:59,200
You know, we come over here.

100
00:07:00,110 --> 00:07:01,780
These are these are all greater.

101
00:07:01,790 --> 00:07:05,600
All of these children that we're putting in are all greater than the parent know that we're attaching

102
00:07:05,600 --> 00:07:05,990
them to your.

103
00:07:08,520 --> 00:07:13,440
So very rarely will the data actually be like that and arrive in that perfect order, so let's see what

104
00:07:13,440 --> 00:07:15,120
a real heap insertion will look like.

105
00:07:15,130 --> 00:07:17,340
So let's say we want to insert tape.

106
00:07:17,640 --> 00:07:21,620
So this is kind of a situation where we're going to do what we did before.

107
00:07:21,630 --> 00:07:24,370
Twenty eight is greater than 25.

108
00:07:24,390 --> 00:07:27,780
We're going to want to put it here, no matter what, because the structural property.

109
00:07:28,790 --> 00:07:33,530
Says that we need to build the heap this way, building it from the left to the right.

110
00:07:35,360 --> 00:07:40,190
So we go ahead and we put twenty eight here what we would do next as we would compare it.

111
00:07:40,340 --> 00:07:43,160
So we would say is 20 less than 25.

112
00:07:44,030 --> 00:07:46,700
No, it's it's not less than 25.

113
00:07:46,970 --> 00:07:50,300
So we don't really have to like worry about doing anything.

114
00:07:50,300 --> 00:07:52,910
The heat property is still satisfied, right?

115
00:07:53,510 --> 00:07:54,920
The mini property here.

116
00:07:56,240 --> 00:07:59,450
So let's say we want to insert three now we know where it's going to go, right?

117
00:07:59,460 --> 00:08:00,530
We just put one right here.

118
00:08:00,530 --> 00:08:02,090
So now we need to put one right here.

119
00:08:02,360 --> 00:08:03,260
That's the next spot.

120
00:08:05,020 --> 00:08:06,610
We go ahead and we put three right there.

121
00:08:08,350 --> 00:08:10,360
Then we say is three less than 25.

122
00:08:10,420 --> 00:08:14,710
Three is less than 25, so we actually need to do something about that.

123
00:08:14,710 --> 00:08:15,820
And what are we going to do?

124
00:08:16,630 --> 00:08:17,920
Well, we're going to swap.

125
00:08:18,310 --> 00:08:21,430
We're going to swap three with twenty five and bring twenty five down here.

126
00:08:22,690 --> 00:08:24,220
So we swap those.

127
00:08:24,730 --> 00:08:26,530
And 25 comes down here.

128
00:08:27,640 --> 00:08:34,810
We're not done yet, though we have to compare it and tell it cannot be basically pushed up anymore.

129
00:08:35,380 --> 00:08:37,630
This is what we would call bubbling up.

130
00:08:38,020 --> 00:08:43,390
So we're taking the value and bubbling it up to the position it belongs in.

131
00:08:43,390 --> 00:08:45,760
So we look at the next parent, right?

132
00:08:45,970 --> 00:08:47,200
Three came up to here.

133
00:08:47,200 --> 00:08:48,430
Twenty five went down.

134
00:08:48,730 --> 00:08:53,020
Now we say, OK, let's check to see if three is less than five.

135
00:08:53,260 --> 00:08:54,100
The parent, right?

136
00:08:54,730 --> 00:08:55,540
Yes, it is.

137
00:08:55,550 --> 00:08:59,470
So we have another situation where it's still listed, so we're going to have to do another swap.

138
00:09:01,120 --> 00:09:02,620
So we swapped three and five here.

139
00:09:02,620 --> 00:09:03,760
Now three is at the top.

140
00:09:04,360 --> 00:09:07,240
So now the heat property is fulfilled, right?

141
00:09:07,630 --> 00:09:13,060
If we look at everything in the heap, we notice that, OK, three children, are they less?

142
00:09:13,060 --> 00:09:14,140
Yeah, five is less.

143
00:09:14,140 --> 00:09:15,130
21 is less.

144
00:09:15,700 --> 00:09:17,850
What about five or 10?

145
00:09:17,860 --> 00:09:20,230
At least it's greater, right?

146
00:09:20,260 --> 00:09:23,570
So three is less than its children, right?

147
00:09:23,590 --> 00:09:25,570
So yeah, five is greater than three.

148
00:09:25,570 --> 00:09:26,770
Twenty one is greater than three.

149
00:09:27,520 --> 00:09:28,020
Five.

150
00:09:28,030 --> 00:09:29,080
Let's look at it's children.

151
00:09:29,080 --> 00:09:30,550
Yeah, twenty eight is greater than five.

152
00:09:30,550 --> 00:09:33,370
Twenty five is carrying the five, so the heat property is satisfied.

153
00:09:33,370 --> 00:09:34,770
The structure is fine.

154
00:09:34,780 --> 00:09:38,590
Everything has been built from the left, so we're looking good.

155
00:09:40,480 --> 00:09:42,460
Let's say that we insert 21.

156
00:09:42,940 --> 00:09:44,840
So this is the next spot.

157
00:09:44,840 --> 00:09:49,210
And just regardless of what the value is, we have to put something here because we're building from

158
00:09:49,210 --> 00:09:50,050
the left to the right.

159
00:09:50,620 --> 00:09:52,720
21 happens to be the same value as the parent.

160
00:09:52,720 --> 00:09:55,120
We go ahead and we check is 21 less than 21.

161
00:09:55,750 --> 00:09:57,280
No, it's not as the same, right?

162
00:09:57,280 --> 00:09:57,730
It's equal.

163
00:09:57,730 --> 00:09:59,920
So we actually don't do anything and we leave it there.

164
00:10:00,160 --> 00:10:07,300
And the heat property is still satisfied because it's a less than or equal to thing, right?

165
00:10:07,720 --> 00:10:11,620
As far as looking at the children, we want the children to be greater than or equal to.

166
00:10:11,920 --> 00:10:18,280
We want the parent to be less than or equal to four men heap, of course, because that's the example

167
00:10:18,280 --> 00:10:19,030
we're covering, right?

168
00:10:20,950 --> 00:10:23,050
So how do we implement a heap?

169
00:10:23,380 --> 00:10:25,350
Do we make nodes and use pointers?

170
00:10:25,370 --> 00:10:33,130
Remember, the binary search tree had a node class and then we kind of had a binary search tree class

171
00:10:33,130 --> 00:10:40,140
where we could have like a left child and a right child right there, the sub trees and stuff like that.

172
00:10:40,150 --> 00:10:43,930
So we were just traversing pointers and creating a data structure on our own.

173
00:10:43,930 --> 00:10:44,590
Like that, right?

174
00:10:45,850 --> 00:10:50,770
So we actually don't have to do that there as hip is so simple that we can just use an array.

175
00:10:52,270 --> 00:10:57,160
And so you might be thinking, well, OK, we have all this stuff in the array, but how do we know

176
00:10:57,160 --> 00:10:58,600
where to put the stuff in there?

177
00:10:58,780 --> 00:11:00,310
Like how does this tree?

178
00:11:01,810 --> 00:11:04,300
Thing translate into an array.

179
00:11:05,860 --> 00:11:11,170
Well, the array is essentially like a flattened version of the tree.

180
00:11:12,200 --> 00:11:17,870
And since the heat property is so simple, right, it's like, you know, we build from left to right

181
00:11:17,870 --> 00:11:27,950
and we also just need to have the children be both less than the parent or if it's a, you know, men

182
00:11:27,950 --> 00:11:32,360
heave, we want the children to both be greater than the parent, right?

183
00:11:33,560 --> 00:11:41,630
So we can actually just mention three kind of properties about the positioning of the elements in the

184
00:11:41,630 --> 00:11:43,760
array to make it heat.

185
00:11:43,850 --> 00:11:44,240
So.

186
00:11:45,600 --> 00:11:53,970
If we say that the index of the left child and so let's say we're talking about some node at position

187
00:11:53,970 --> 00:11:57,840
I so for example, let's take a look at the root node, right?

188
00:11:58,800 --> 00:12:02,040
We noticed that three is the root of this tree right here.

189
00:12:02,460 --> 00:12:03,990
And let's take a look at the array.

190
00:12:04,500 --> 00:12:07,170
Three Is it the first position, right?

191
00:12:07,180 --> 00:12:09,620
So the rule will always be at the first position.

192
00:12:09,630 --> 00:12:11,070
You can always just remember that.

193
00:12:12,350 --> 00:12:16,370
So what is the index of the Route three?

194
00:12:16,880 --> 00:12:17,930
Well, it's zero.

195
00:12:18,770 --> 00:12:20,930
So let's take a look at this property right here.

196
00:12:20,930 --> 00:12:25,790
Index of left child of the node at two eye plus one.

197
00:12:26,120 --> 00:12:27,480
So let's look at the tree.

198
00:12:27,500 --> 00:12:30,050
What is the left child of the three?

199
00:12:30,380 --> 00:12:31,460
It's five, right?

200
00:12:32,210 --> 00:12:33,990
This says two is plus one.

201
00:12:34,010 --> 00:12:35,630
Well, what's eye in this case?

202
00:12:35,630 --> 00:12:42,410
I is the index and zero two times zero plus one is one right?

203
00:12:42,500 --> 00:12:43,380
Zero plus one.

204
00:12:43,400 --> 00:12:45,530
So we get to index one, right?

205
00:12:46,130 --> 00:12:47,750
That's the answer of this right here.

206
00:12:48,260 --> 00:12:50,510
So if you go to index one was there, it's five.

207
00:12:51,120 --> 00:12:51,880
Oh, well, yes.

208
00:12:51,880 --> 00:12:53,390
So it corresponds with the left one.

209
00:12:53,490 --> 00:12:58,220
Let's take a look at this index of right child at two plus two.

210
00:12:59,270 --> 00:13:01,310
So two times zero plus two is two.

211
00:13:01,940 --> 00:13:03,460
What is the right child of three?

212
00:13:03,470 --> 00:13:07,430
It's 21, two times zero plus two is two, we said.

213
00:13:07,430 --> 00:13:10,190
So if we go to index two, it's twenty one.

214
00:13:11,280 --> 00:13:12,060
Well, let's check.

215
00:13:12,080 --> 00:13:13,130
Let's check some other stuff.

216
00:13:13,130 --> 00:13:14,390
So we'll just check the whole tree.

217
00:13:14,870 --> 00:13:15,530
Five.

218
00:13:15,710 --> 00:13:17,750
Right, so left child.

219
00:13:17,750 --> 00:13:20,090
Twenty eight two times.

220
00:13:20,090 --> 00:13:23,780
Five say the it was the index of five.

221
00:13:23,780 --> 00:13:24,560
It's one right.

222
00:13:25,190 --> 00:13:27,260
Two times one plus one is three.

223
00:13:28,370 --> 00:13:29,870
So let's go to index three.

224
00:13:29,870 --> 00:13:31,040
It's twenty eight right.

225
00:13:31,040 --> 00:13:33,200
So there's the left child appropriately stored.

226
00:13:34,190 --> 00:13:41,930
And then what about the right child, so the right child is to two times II plus two eyes, one right

227
00:13:41,930 --> 00:13:45,290
for five, so we have two plus two, that's four.

228
00:13:45,800 --> 00:13:50,480
So we go to index for us, there's 25 that corresponds with the tree as well, and then 21.

229
00:13:50,930 --> 00:13:52,310
Let's just go ahead and look at that.

230
00:13:53,100 --> 00:13:54,530
So 21.

231
00:13:56,650 --> 00:14:04,960
If we look at where that is stored, it's that well, this is this this position right here, we can

232
00:14:05,320 --> 00:14:07,090
look at this, this 21 right here.

233
00:14:07,180 --> 00:14:08,500
We have two ones in here.

234
00:14:08,500 --> 00:14:08,770
But.

235
00:14:10,120 --> 00:14:16,540
If we look at this twenty one right here, if we go to a times two plus one, right?

236
00:14:16,960 --> 00:14:19,510
That's five if you look right here.

237
00:14:19,840 --> 00:14:21,190
Twenty one is the child right?

238
00:14:21,190 --> 00:14:22,320
And we look at index five.

239
00:14:22,330 --> 00:14:23,170
Twenty one is here.

240
00:14:24,580 --> 00:14:29,530
So I just want to walk you through and show you really what it all breaks down to as in putting it in

241
00:14:29,530 --> 00:14:30,160
the array.

242
00:14:30,340 --> 00:14:38,620
So when we flatten this out, the reason why we can use an array is our ability to use these formulas

243
00:14:38,620 --> 00:14:40,900
to be able to access the children.

244
00:14:41,230 --> 00:14:42,680
And it works, vice versa.

245
00:14:43,120 --> 00:14:44,530
You know, the opposite way as well.

246
00:14:44,560 --> 00:14:49,810
The index of the parent can be said to be at the floor, so we'll kind of like round down, right?

247
00:14:51,260 --> 00:14:55,220
Of I minus one, so index minus one divided by two.

248
00:14:56,420 --> 00:15:00,470
So, for example, let's just take a look at like twenty one.

249
00:15:01,860 --> 00:15:03,480
At the very bottom here, so.

250
00:15:04,540 --> 00:15:06,250
Twenty one is the index five, right?

251
00:15:06,430 --> 00:15:11,800
So if we say five minus one, that's four and we do four divided by two.

252
00:15:11,830 --> 00:15:14,630
Well, that divide evenly, right?

253
00:15:14,650 --> 00:15:18,970
So we say four divided by two is two and that gives us twenty one.

254
00:15:19,720 --> 00:15:21,610
Let's take something over here, for example.

255
00:15:21,620 --> 00:15:23,950
So what about this?

256
00:15:25,110 --> 00:15:26,430
Like twenty five, right?

257
00:15:26,460 --> 00:15:30,540
Twenty five, is it for four, minus one is three.

258
00:15:31,500 --> 00:15:33,600
Three divided by two.

259
00:15:34,860 --> 00:15:38,850
We're just going to round that down and say that it goes in one, right?

260
00:15:39,240 --> 00:15:45,630
So if we go to here, if we say that the answer's one, we see that the parent is stored there.

261
00:15:45,720 --> 00:15:46,140
Five.

262
00:15:48,180 --> 00:15:49,890
So pretty cool, right?

263
00:15:51,580 --> 00:15:54,320
So what is all this even useful for?

264
00:15:54,350 --> 00:15:57,450
Like, why would we use a heap over some other data structure?

265
00:15:57,640 --> 00:16:03,940
Well, heaps are really useful for keeping track of the minimum or maximum values in your data collection.

266
00:16:04,420 --> 00:16:12,160
There also is a cool, efficient sorting algorithm that we will look at in a lecture or two in the future,

267
00:16:12,370 --> 00:16:15,850
which is heap sort and that uses a heap.

268
00:16:17,020 --> 00:16:20,980
So also, just in general, most operations on Heap are quite efficient.

269
00:16:21,280 --> 00:16:26,890
We will be looking at the time complexity of certain operations, and you'll notice that most of them

270
00:16:26,890 --> 00:16:33,730
are like, you know, logarithmic or you might have like in log in if you're building an entire heap

271
00:16:33,730 --> 00:16:41,680
or you might just have linear time and or, you know, even constant time as far as finding the maximum

272
00:16:41,680 --> 00:16:42,490
or minimum thing.

273
00:16:42,940 --> 00:16:45,400
So definitely a pretty efficient data structure.

274
00:16:46,510 --> 00:16:46,780
All right.

275
00:16:46,780 --> 00:16:49,810
So that hopefully serves as a decent introduction to heaps.

276
00:16:50,140 --> 00:16:53,020
In the next few lectures, we'll be getting into more specifics.

277
00:16:53,020 --> 00:16:58,480
So we'll be talking about not only how to insert things in the heat, but how to delete things and how

278
00:16:58,480 --> 00:17:03,430
to make sure that the heap stays a heap when you are deleting items.

279
00:17:03,730 --> 00:17:08,330
We'll also talk about heaps sort and also really cool lecture.

280
00:17:08,680 --> 00:17:13,480
Hopefully, we can talk about a quicker, more efficient way to build a heap as well.

281
00:17:14,590 --> 00:17:14,830
All right.

282
00:17:14,830 --> 00:17:16,360
So with that, I'll see you in the next lecture.
