@Techdose10:17 Your explanation is far better... I have a doubt... For Range of leaves (CBT) - y don't you use ceil of (n/2) instead of floor(n/2)+1? And the array need be always in increasing and decreasing order right?
i enjoy these videos but i want to give just 1 tiny advice try to say binAry not binDry tree, after first few videos i got used to it somewhat but its stil strange hearing bindary other than that its all good and informative so thank you
I think the definition of height of a node in this video is wrong. The height of a node is defined as the number of edges from that node to the deepest leaf. So all the leaf nodes will have a height of 0 and root node will have the maximum height and that would be consider to the height of the tree itself. Please correct me if I'm wrong.
ceil aka ceiling with its brother floor aka flooring what it means ceil -> returns the smallest integer value which is greater than or equal to the specified number for example ceil(1.5) = 2 cause 2 is the smallest and greater integer while floor(1.5) = 1 because its the opposite of ceiling as in returns the closest integer that is smaller than or equal to the specified number and its not the same as rounding dont get confused because ceil(1.2) is also = 2 and floor (1.9) is stil = 1
10:56 timestamp For ACBT(Almost complete binary tree) internal node (for N=5) will be from 1 to 3 [1 based indexing]. Someone please correct me if I'm wrong.
It's great video but I don't understand one concept. How does the range of leaves and range of internal nodes take the maximum value in the given formula? For example, we said the range of leaves for tree with N nodes is floor(N/2) + 1 to N. When N is 7, we get leaves = 4 obviously but how we can get leaves = 7 according to the formula the ranges of leaves will be from 4 to 7?
oh I get it now after watching the next video on heapify algorithm. I thought the range of leaves means the number of leaves it can have. But actually it is the index values of leaves representation in the array.
sir help me clear this doubt , what happens when the child node of first element is greater than the sibling node of first element then at that time how does it gonna find the k max element in the heap: for example , 90 / \ 75 68 / \ 80 45 In this 80>68 and according to heap traversal it traverse from left to right so when it will traverse in second row it's gonna return that 68 is the third largest element.
if i understand correctly your example is not a max heap because your values are not in order a max heap would be like: 90 / \ 80 75 / \ 68 45 this would be a max heap for sure but maybe what you meant to ask is what if we have something like this: 90 / \ 80 75 / \ / 68 45 60 would this count as a max heap? or does the numbers need to also be descending from all the way left to right?? i have no idea yet like can it be 68 45 60 or need to be as 68 60 45 in order to be considered a max heap BUT REGARDLESS in MAX heap the ROOT aka 90 in our example will be always the biggest number encountered in the tree thats guaranteed else its not a MAX heap
STL is like V = IR (Ohm's Law formula) Implementation of DSA is like learning how Ohm's Law came into picture :) Can you be a good engineer by just mugging up formula ?
No bullshit and straight to the point, I really like your explanation and way of teaching. Awesome!!
Thanks 😊
+1
i have searched through many channels for heaps..but none beats this....very clear explanation...
Thanks
Bhai please have a smile on your face. Thank you so much for adding valuable content on TH-cam. I would like to see a smile on your face ♥
Thanks for your motivation ☺️
@@techdose4u You are the motivation and inspiration for all the students. We all are proud to have a teacher like you 💪
Thanks :) I wish our student base will keep on increasing and the course helps maximum of them 🤓
@@techdose4u We need to be next to the entrepreneurs of the World 💪
This is clear explanation of Heap Data Structure. Really nice video. Please keep producing such contents.
Man you are one hell of a teacher. Impressed 👌
Thanks :)
Superb Heap DS Course on the Entire Planet 😊🙏
Thanks :)
thank you , your way in explaining is amazing
Best tutorial on TH-cam 🔥🔥
Thanks :)
this is so useful and helpful! so glad i found this course, much thanks to you for teaching this sir ❤❤
Finally understood Heaps, huge thanks!
Welcome 😊
Very Impressive way of teaching ....No bullshit direct coming to the point...👍👍👍
At 11:29 in the first tree if I swap tree nodes having value 6 and 7 then it will still be a maxheap but the array wont be in decreasing order..
@sagarsingh-wb8ou Yeah you are right, it need not be always in decreasing and increasing order
the statement mentioned is w.r.t array and not vice versa so it holds true
Bessttt thing I found today 🔥
:)
@Techdose10:17 Your explanation is far better... I have a doubt...
For Range of leaves (CBT) - y don't you use ceil of (n/2) instead of floor(n/2)+1?
And the array need be always in increasing and decreasing order right?
Keep up the good work :)
Thanks
Awesome content. Thanks a lot. :)
Welcome :)
At 0:30 is that level order ?
i enjoy these videos but i want to give just 1 tiny advice try to say binAry not binDry tree, after first few videos i got used to it somewhat but its stil strange hearing bindary other than that its all good and informative so thank you
superb explanation..
Thanks 😊
brother can you please make a video on, I found it very difficult. 1371. Find the Longest Substring Containing Vowels in Even Counts
I think the definition of height of a node in this video is wrong. The height of a node is defined as the number of edges from that node to the deepest leaf. So all the leaf nodes will have a height of 0 and root node will have the maximum height and that would be consider to the height of the tree itself. Please correct me if I'm wrong.
Which drawing software u r using sir ?
Would I have to learn all these formulae?
thank you so much
I’m sorry I don’t understand how i/2-1 works? In your example is 3/2=2? How does 3/2 = 2?
ceil of 3/2 is 2
ceil aka ceiling with its brother floor aka flooring
what it means ceil -> returns the smallest integer value which is greater than or equal to the specified number
for example ceil(1.5) = 2 cause 2 is the smallest and greater integer
while floor(1.5) = 1 because its the opposite of ceiling as in returns the closest integer that is smaller than or equal to the specified number
and its not the same as rounding dont get confused
because ceil(1.2) is also = 2
and floor (1.9) is stil = 1
10:56 timestamp
For ACBT(Almost complete binary tree) internal node (for N=5) will be from 1 to 3 [1 based indexing]. Someone please correct me if I'm wrong.
Note that, the node:3 is no longer an internal node its a leaf so the internal nodes are just {1, 2} and leaf nodes: {4, 5, 3}
@rajdeepmallick9803
floor (5/2) is 2, so it is from (1-2)
well DONE
It's great video but I don't understand one concept. How does the range of leaves and range of internal nodes take the maximum value in the given formula? For example, we said the range of leaves for tree with N nodes is floor(N/2) + 1 to N. When N is 7, we get leaves = 4 obviously but how we can get leaves = 7 according to the formula the ranges of leaves will be from 4 to 7?
oh I get it now after watching the next video on heapify algorithm. I thought the range of leaves means the number of leaves it can have. But actually it is the index values of leaves representation in the array.
Sir plzz make a video how to solution codechef questions
Think and solve. Else copy like others. Or wait for Editorials.
at this point, it's all about finding the perfect Indian guy to explain complex things to you 😅😁
😂
sir help me clear this doubt , what happens when the child node of first element is greater than the sibling node of first element then at that time how does it gonna find the k max element in the heap: for example ,
90
/ \
75 68
/ \
80 45 In this 80>68 and according to heap traversal it traverse from left to right so when it will traverse in second row it's gonna return that 68 is the third largest element.
if i understand correctly your example is not a max heap because your values are not in order a max heap would be like:
90
/ \
80 75
/ \
68 45 this would be a max heap for sure but maybe what you meant to ask is what if we have something like this:
90
/ \
80 75
/ \ /
68 45 60
would this count as a max heap? or does the numbers need to also be descending from all the way left to right?? i have no idea yet
like can it be 68 45 60 or need to be as 68 60 45 in order to be considered a max heap
BUT REGARDLESS in MAX heap the ROOT aka 90 in our example will be always the biggest number encountered in the tree thats guaranteed else its not a MAX heap
thank you sir
Welcome
Hi sir .can you please make a video on leetcode problem named
.maximum no of events we can attend sir..or atleast add to your to do queue sir.
Will try
i am confused that am i wasting my time by learning the implementation? should not i go with stl??
STL is like V = IR (Ohm's Law formula)
Implementation of DSA is like learning how Ohm's Law came into picture :)
Can you be a good engineer by just mugging up formula ?
sir, can you provide the pdf of the notes you making in this video.
Diamond Content
can i get a copy of this ?
Accessing a parent has to be (index - 1)/2. You mentioned as index/2 - 1. Which is not correct in zero based index array.
He said that take ceil of index/2 then subtract 1
DS God
😅
😎
👍👍👍👍☺☺👏👏👏
👌🏼
we take degree from university but learn from youtube. u !
:)