QUICK CORRECTION: I used the terms "double" and "float" interchangeably for this video. The two numeric data types are, in fact, not the same. Doubles are more precise than floats, as they can store 64 bits, whereas floats store 32 bits. It doesn't change anything regarding the solution, but I didn't want to mislead you either in terminology!
Started recently following you - I always find it difficult to identify the heap data structure for these kind of problems. I like the way you explain. Keep doing this kind of work. Would like connect with you. Are you from USA?
@@babybear-hq9yd that's fine. I was thinking about creating a list of 100 items and for other 1 percent, we can use left_max and right_min heap as it is!
Hey, the part where you make min heap act like max heap and max heap act like min heap, can we apply the same way for any problem where we have to make min heap act like max heap and vice versa?
Short answer: generally, yes. I do want to elaborate a bit though and say that we didn't actually make a min heap act like a max heap. It served the purpose as a min heap would. In Python, the heapq library instantiates a min heap by default. So, if you want a max heap, you need to push and pop the negation of the elements. If you're in a language that has only a max heap implemented, then you could definitely use the same method to make it a "de facto" min heap. Does that answer your question?
QUICK CORRECTION: I used the terms "double" and "float" interchangeably for this video. The two numeric data types are, in fact, not the same. Doubles are more precise than floats, as they can store 64 bits, whereas floats store 32 bits. It doesn't change anything regarding the solution, but I didn't want to mislead you either in terminology!
best solution and walk through ! you are really a gem. Thank you!
Ahhh Tysm!!!
hey Aleks, great video! really well explained!
Started recently following you - I always find it difficult to identify the heap data structure for these kind of problems. I like the way you explain. Keep doing this kind of work. Would like connect with you. Are you from USA?
so happy to help :D and nope, i'm a canadian baby
could you please do the skyline problem
Could you please add a video for the follow-up part? Maybe segment trees? Thanks
i may get to it at some point but not in the near future most likely :(
@@babybear-hq9yd that's fine. I was thinking about creating a list of 100 items and for other 1 percent, we can use left_max and right_min heap as it is!
great explanation
ty :)
Heyy. Its been a really long time since you uploaded a new video
nice explaination! I think there is no need to heapify the initial heap "[]".
i think you're right :) i include it in these videos just to really overdeliver on clarity of each step
Hey, the part where you make min heap act like max heap and max heap act like min heap, can we apply the same way for any problem where we have to make min heap act like max heap and vice versa?
Short answer: generally, yes. I do want to elaborate a bit though and say that we didn't actually make a min heap act like a max heap. It served the purpose as a min heap would. In Python, the heapq library instantiates a min heap by default. So, if you want a max heap, you need to push and pop the negation of the elements. If you're in a language that has only a max heap implemented, then you could definitely use the same method to make it a "de facto" min heap. Does that answer your question?
@@babybear-hq9yd Yes, Thanks for the detailed explanation :)
'I have an allergic reaction every time I see one of these (over the top) solutions" no because same lol
Very nice !!!!👍👍👍
thank you thank you! 🙇♂️
Amazing