Complete Trees Practice - Noob to Expert | Topic Stream 3

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

КОМЕНТАРІ • 28

  • @mehulsethi5886
    @mehulsethi5886 4 роки тому +8

    Damn colin, people really be asking you to say their name , you a celeb.

    • @DreaMagnifier
      @DreaMagnifier 4 роки тому +10

      its more fine than simple tik tokers or youtube roaster saying them self so called a star. galen colin is intelligent and he deserve a place of celebrity.

  • @AnonymousProdigy
    @AnonymousProdigy 3 роки тому +1

    Ur channel is underrated ... thanku so much buddy...pls make a series on how to master data structure and algorithms .. how to start competitive coding.. how to approach a algorithmic problem..it's my sincere request..

  • @kimjong-un4521
    @kimjong-un4521 2 роки тому +1

    Time to learn from Legend. Come to my country.

  • @Vaidikjagani-u4q
    @Vaidikjagani-u4q Рік тому

    In the first question, how is vector using the push_back method? shouldn't the declaration for children be vector? Why is this code working it should be a compilation error.

  • @loveparashar4114
    @loveparashar4114 3 роки тому +7

    Nice videos can U upload videos on queries on trees please:) as It is asked most frequently in many companies coding round:)

  • @jezzdat2kk5
    @jezzdat2kk5 10 місяців тому

    this means so much to me , tysm

  • @adityasaxena6971
    @adityasaxena6971 2 місяці тому

    Thanks

  • @ankitsingh-rb8pc
    @ankitsingh-rb8pc 4 роки тому +3

    this stream is really great thanks alot for this

  • @rahulkarad8447
    @rahulkarad8447 4 роки тому +8

    Use Epic pen instead of Paint (i think that would be more easier)

  • @arinroday302
    @arinroday302 4 роки тому +3

    dear galen colin, please use a graphic tablet paired with OneNote or something similar for such long lectures, would be easy for you and us too

  • @hardikraj3175
    @hardikraj3175 4 роки тому +2

    Can you make a stream on Binary Search questions?

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

    Amazing Galen,,,,,,

  • @memoryLeak-CODE
    @memoryLeak-CODE 5 місяців тому

    AWESOME!

  • @CristianRodriguez-it7il
    @CristianRodriguez-it7il 9 місяців тому

    NIce video, thanks!

  • @hardikraj9469
    @hardikraj9469 4 роки тому

    Why '+1' in Mashup B? I still don't understand that.

    • @mehulsethi5886
      @mehulsethi5886 4 роки тому

      because we need 1 to reach the children and then we find the average of distances of the children
      it basically that before finding the avg of children we need to reach children right? so +1 is distance to reach the children.

    • @hardikraj9469
      @hardikraj9469 4 роки тому

      @@mehulsethi5886 Okay it somewhat makes sense. But what if the edge lengths were different? Would we still have added '+1' or some other number?

    • @mehulsethi5886
      @mehulsethi5886 4 роки тому

      @@hardikraj9469 we would have added the edge length in that case

    • @hardikraj9469
      @hardikraj9469 4 роки тому

      @@mehulsethi5886 What if the edge lengths were different? Would we have added the maximum or the minimum edge length?

    • @mehulsethi5886
      @mehulsethi5886 4 роки тому +1

      @@hardikraj9469 the average of all edge lengths

  • @devangsrivastava6736
    @devangsrivastava6736 2 роки тому +2

    as someone trying to code in python ,i find these problems offensive

  • @omkathe3599
    @omkathe3599 3 роки тому +1

    In problem B why can't we make a directed tree/ graph? Because we know we start from 1, so we can start from it. And we cannot re visit the parent so we will add directed edge from parent to child. Why doesn't this work? I tried but got wrong answer on test case 4.

    • @ColinGalen
      @ColinGalen  3 роки тому +5

      The problem is, you don't know which of the edges is the parent without running a DFS for more complicated trees. For example, take:
      1 2
      2 4
      4 3
      5 4
      where there's no good order to direct an edge (e.g. 4 is the parent of 3, but 5 is not the parent of 4)

    • @omkathe3599
      @omkathe3599 3 роки тому +1

      @@ColinGalen Got it. Thank You!