Data Structures: Heaps

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Storing the heap in the form of an array just blew my mind...so effective

harshitm
Автор

This is one of Gayle Laakmann's best videos. She walks us through the code, array, and tree versions while speaking calmly in a pleasant voice. Thank you!

WorklLife
Автор

3:22 "Aaand there we go, we've created Minecraft!"

Saztog
Автор

If you're trying to write this code in Python, beware: You cannot simply assign items[0] = items[self.size - 1]. You must pop() the item at the end of the list to remove it: items[0] = items.pop() ... also be sure to use floor division in the parent calc if using Python 3: (index - 1) // 2

hammerain
Автор

Just an FYI: At 3:01 timeframe, you are showing formulas and for pareint you have [Index -2) / 2]. This needs to be change dto index -1 * 2. On next screen where you are coding it, you have it right.

sherazdotnet
Автор

Her keyboard clicks are the most satisfying sound

johnkimura
Автор

Possible error around 2:52
The diagram shows the parent as (index-2)/2, when it should be (index-1)/2

PsyKosh
Автор

The calculation shown in the cartoon diagram to get the parent of the node is shown as (index-2)/2. In the code the calculation is (index-1)/2.

NathanSowatskey
Автор

Clean implementation. Clean explanation. Wonderful video! Thank you very much for taking the time to make this. I really needed it!

octamodius
Автор

The explanation with the code is amazzing !! loved it....seems that would work for me! Please continue with the good work

harshwardhankoushik
Автор

Having that visual next to the code is such a godsent, thank you for saving my bachelors degree

MrJakson
Автор

I read about heaps online and first implemented it using a right and left Node. I felt array, though - spidey senses. I wish I would have seen it on my own. But, this video was a close second. Thank you so much for a clear description.

LeaFox
Автор

Pro tip: if your array is indexed at 1 (like with Fortran) the pointers are parent: (index-1)/2, left child:2*index, right child:2*index +1

CamdenBloke
Автор

Best video explanation with code walkthrough showing how to answer the ubiquitous lazy interviewer question "Implement a Heap data structure".

AlexXPandian
Автор

I forgot this channel existed. It saved me once again

guadalupevictoriamartinez
Автор

This is a really nice explanation of min heaps.... Very nice, very clear, very simple, concise and short enough to pick up in a jiffy. Thanks Gayle.

BeginningProgrammer
Автор

The video feels incomplete because it never explains what a heap is used for, though the data structure very well.

mvcds
Автор

Most of coders strugles to use complex abstract data structures like heaps or graphs because they dont learn it from a concrete use case.

mrafik
Автор

Possible error at 1:54 the algorithm is said to be swapping with the smallest of the 2 child elements (when bubbling down) So 20 is swapped with 4, then the pointer is swapped with 9 (left child) while the right child is 7 - smaller.

ophir
Автор

I am translating these lessons for use in Unreal Engine Visual Blueprints, and Gayle delivers these lessons very cohesively. Thank You!

murnoth