Heaps & Priority Queues - Heapify, Heap Sort, Heapq Library - DSA Course in Python Lecture 9

preview_player
Показать описание


Please check my playlists for free DSA problem solutions:

My Favorite Courses:

Data Structures & Algorithms:

Python:

Web Dev / Full Stack:

Cloud Development:

Game Development:

SQL & Data Science:

Machine Learning & AI:
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

On the pop is important that you substitute the top element by the rightmost element on the heap, that way you maintain the balance property of the heap, after that you heapify down.
The way it was presented may cause confusion, beacause if you just remove the element on the top and do the rearranjement, the heap may become unbalanced

TaskForcebr
Автор

wow! This channel is so underrated. Thankyou!!

Brusselsprouts
Автор

Greg you missed the complete binary tree property of Heap at 5:20

updownftw
Автор

Nice video brother. It help me a lot. Love you from Bangladesh.

mohammodroby
Автор

These videos are great. Much love Greg

Jay-ekuw
Автор

The pop heap described h err e is incorrect, as it does not maintain the heap property which has the has the leaf nodes filled from left, so it messes up the array structure essentially, please pay attention to the details and correct it if it causes confusions.

jingwenwang
Автор

thank you man to negate the values to use it as max heap was awesome trick ❤❤❤

kapilrules
Автор

Thank you for your explanation. I love how you explain the theory, but I expected more about the coding section. I hope something from scratch to understand the theory. Anw, thank you so much

sonhoang
Автор

Thank you a lot !! Please more videos like that

Abzal-pdri
Автор

thank you so much for your clear explaination👍👍

karamalrasam
Автор

Can't wait to see the dp or backtracking lesson (my national programming contest is soon and I suck a both)

ahmedzz
Автор

Could you do a course on linked lists please?

Karandeepsingh-kkrv
Автор

0:15 bro hitting puberty lol. Great video, well explained

adventurer
Автор

What would happen if that -10 was a leaf node when you were heapifying the min heap? The leaf nodes were ignored but presumably in that case that -10 would need to get to the top?

garythegoat
Автор

Your tree at 11:55 doesn't satisfy the condition of a heap as the last level wasn't filled from left to right

erons_xo
Автор

23:45 You said the heap is set according to the smallest frequency. So why is (3, 4) placed after (4, 5) in the heap array?

PS: Started watching this course recently, loving it so far!

devshah
Автор

Hey greg, wouldn't the Heapify function be O(n.log(n)), since for every node in the tree of N nodes, you need to perform "Sift down" which itself is O(log(n))?

godcomplex
Автор

that was very helpful and clear thanks man you really great ♡♡

ibraheem_Zain
Автор

Quick question : How are you able to print the trees beautifully at 14:47 ? I can't find any inbuilt function.

navneetkumar