FIND MEDIAN FROM DATA STREAM (Leetcode) - Code & Whiteboard

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 22

  • @babybear-hq9yd
    @babybear-hq9yd  3 роки тому +1

    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!

  • @Cloud-577
    @Cloud-577 2 роки тому

    best solution and walk through ! you are really a gem. Thank you!

  • @arjunbharadwaj1820
    @arjunbharadwaj1820 3 роки тому

    hey Aleks, great video! really well explained!

  • @HarshaVardhan-ky2gr
    @HarshaVardhan-ky2gr 3 роки тому

    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
      @babybear-hq9yd  3 роки тому

      so happy to help :D and nope, i'm a canadian baby

  • @Cloud-577
    @Cloud-577 2 роки тому

    could you please do the skyline problem

  • @manmaybarot4768
    @manmaybarot4768 3 роки тому

    Could you please add a video for the follow-up part? Maybe segment trees? Thanks

    • @babybear-hq9yd
      @babybear-hq9yd  3 роки тому +1

      i may get to it at some point but not in the near future most likely :(

    • @manmaybarot4768
      @manmaybarot4768 3 роки тому

      @@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!

  • @vinaylakhani3033
    @vinaylakhani3033 3 роки тому

    great explanation

  • @utkarshkumar5349
    @utkarshkumar5349 2 роки тому

    Heyy. Its been a really long time since you uploaded a new video

  • @wenlongwu6650
    @wenlongwu6650 3 роки тому

    nice explaination! I think there is no need to heapify the initial heap "[]".

    • @babybear-hq9yd
      @babybear-hq9yd  3 роки тому +1

      i think you're right :) i include it in these videos just to really overdeliver on clarity of each step

  • @jahnavijonnalagadda3076
    @jahnavijonnalagadda3076 3 роки тому

    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?

    • @babybear-hq9yd
      @babybear-hq9yd  3 роки тому +1

      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?

    • @jahnavijonnalagadda3076
      @jahnavijonnalagadda3076 3 роки тому

      @@babybear-hq9yd Yes, Thanks for the detailed explanation :)

  • @Cloud-577
    @Cloud-577 2 роки тому

    'I have an allergic reaction every time I see one of these (over the top) solutions" no because same lol

  • @DoskarinMarlen
    @DoskarinMarlen 3 роки тому

    Very nice !!!!👍👍👍

  • @ahmedsafwat8331
    @ahmedsafwat8331 3 роки тому

    Amazing