INORDER SUCCESSOR in binary search tree[CODE Explained]

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 103

  • @hydraphelhd3291
    @hydraphelhd3291 2 года назад +3

    The way you just explain everything 20 times over again is amazing. It really engraves the content into my mind. Great video!

    • @tori_bam
      @tori_bam 7 месяцев назад

      I didn't understand this until i watched the video. so true! lol

  • @d0minar
    @d0minar 4 года назад +7

    Probably the only explanation on RUclips that is perfectly clear. Thank you my friend!

  • @egemen_ozturk
    @egemen_ozturk 2 года назад

    I can't explain how valuable this video is. Thank you so much. Best explanation in the YT so far.

  • @arshad6027
    @arshad6027 7 дней назад

    only explanation in youtube covering all the cases👍

  • @syednoorullahshah9194
    @syednoorullahshah9194 6 лет назад +7

    awesome explaination.. i thought this topic was my full stop for the DSA course which i'm studying online until i came across ur video.. thank you so much.. i am ready to continue :) you got a new subscriber here #respect

  • @gawarivivek
    @gawarivivek 3 года назад

    This is the best explanation so far on Inorder Successor. You are a great teacher. Thanks a ton!! :)

  • @dhananajaykrishna8259
    @dhananajaykrishna8259 3 года назад

    Best explanation ever.... All your videos are lucid and to the point. Keep it up... Thank you

  • @gauravsinha2077
    @gauravsinha2077 3 года назад

    This is the best explanation . Awesome!! I wish all teachers were this good India would have been going greats

  • @ankitshaw5375
    @ankitshaw5375 4 года назад

    Thank you sir .Your explanations are best and i have learned a lot from you.Keep making videos like this.

  • @sourabhsachdeva12
    @sourabhsachdeva12 4 года назад

    Explanation work is done well but the boundary case if we have to find successor of maximum node in tree will not be handled by this algo

  • @17ANP
    @17ANP 4 года назад +1

    Amazing explanation!
    Just a quick question:
    The time complexity of the solution shall be O(height) but should the space complexity be also O(height) => Recursive calls to search for the target node for BST?

  • @gurjarc1
    @gurjarc1 6 лет назад

    Very nice explanation. you are one the few guys who try to explain how to think. Awesome.

  • @mmorales0113
    @mmorales0113 3 года назад

    Best explanation on the web. Thanks!!

  • @hailemariamtamirat3125
    @hailemariamtamirat3125 3 года назад

    What an explanation!! This should how professors teach teach their students. Keep it up! Thanks for uploading this well explained and organized video.

  • @hayatabadcomputeracademy4516
    @hayatabadcomputeracademy4516 4 года назад

    Thanks from your explanation, which is easy to understand, a confusion is here how to find the in order successor for 36 in the above example? please help me it is much urgent for me.

  • @abirhossainrohan8067
    @abirhossainrohan8067 5 лет назад +1

    sir explanation is really great

  • @TharaMesseroux1
    @TharaMesseroux1 3 года назад +1

    Thank you, Vivekanand! We appreciate you!

  • @linonator
    @linonator 2 года назад

    This was a really good explanation. Thanks a lot

  • @jaitehkaba8753
    @jaitehkaba8753 4 года назад

    Way better than my fucking CS class at a "top" American University. He is so composed, I love it and absorbing everything .

  • @ronaldweasly561
    @ronaldweasly561 2 года назад

    from case 2, i do from bottom, so i start looking its successor from the key (37) than i compare it with parent and another node, final result is same 40

  • @tushargoel2220
    @tushargoel2220 6 лет назад +2

    Can you please do a series of algorithm questions for interview prep in a week. Sort of like things you absolutely need to know

  • @cindy0092
    @cindy0092 6 лет назад +2

    what about the case where target is 105? how to check if that is the last node of the tree?

  • @nomanakhtar9763
    @nomanakhtar9763 4 года назад

    One of the best explanation

  • @abbasikov
    @abbasikov 7 лет назад

    You are given a list of projects and a list of dependencies ( which is a list of pairs of projects, where the second project is dependent on the first project). All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. if there is no valid build order, return an error.
    Input:
    projects: a, b, c, d, e, f
    dependencies: (a,d), (f,b), (b,d), (f,a), (d,c)
    Output: f, e, a, b, d, c

    • @Kkvishwakarma148
      @Kkvishwakarma148 7 лет назад

      Read about Topological Sorting using Stack, that would help you.

  • @ayaramzy6815
    @ayaramzy6815 3 года назад

    u r amazing .. hope you land the best companies

  • @m.mubashar786
    @m.mubashar786 3 года назад

    very nice explaining sir....You rocked

  • @therealltrader2346
    @therealltrader2346 4 года назад

    very great explanations sir

  • @ibrahimshaikh3642
    @ibrahimshaikh3642 5 лет назад

    Very helpful, especially explanation with example

  • @ArpitDhamija
    @ArpitDhamija 4 года назад +1

    hi sir, can you please make more algorithms videos on trees, linked list, graphs, and some other important algorithms for interviews

  • @sunnyjain630
    @sunnyjain630 6 лет назад

    easy and lucid way of teaching.......!thanks

  • @dhawalpatel3310
    @dhawalpatel3310 7 лет назад

    Hi vevekanand, thanks for such a wonderful explanation. You mentioned that tree cannot be reversely traversed, means backtracking. But we can achieve the same using recursion. Please let me know your thoughts on that.

  • @sumitghewade2002
    @sumitghewade2002 4 года назад

    Thanks a lot for explaining so beautifully.

  • @sachinshet6285
    @sachinshet6285 5 лет назад

    Sir, please use duster, rubbing the marker ink through your fingers may cause skin problems.

  • @채서영-d4l
    @채서영-d4l 4 года назад

    BEST explanation I've ever seen

  • @travellertripper4129
    @travellertripper4129 4 года назад +1

    awesome Sirji!

  • @swornimbaral9176
    @swornimbaral9176 6 лет назад

    Vivekanand sir would you please explain the time complexity of the algorithm also?

  • @chandanagp3960
    @chandanagp3960 6 лет назад

    Thank you very much for the great explanation in all your videos..keep going

  • @anshumanjain6368
    @anshumanjain6368 4 года назад

    nice explanation. thank you.

  • @DOCtorActoAntohich
    @DOCtorActoAntohich 4 года назад

    Thank you, this was the best material on the topic

  • @rahulchudasama9363
    @rahulchudasama9363 4 года назад

    awesome explaination

  • @souvikdas7200
    @souvikdas7200 6 лет назад +1

    Sir what will be the output for the value 105? Here I was getting garbage value but tried to solve by means of some logic but problem is not fixed. Will you please discuss that? Thanks again.

    • @mrvenom5088
      @mrvenom5088 6 лет назад +1

      It should be null. Perhaps if the node is the maximum node in a bst then its successor will always be a null.

  • @MTB_Bay_Area
    @MTB_Bay_Area 2 года назад

    Excellent, thank you.

  • @kabboghosh1853
    @kabboghosh1853 5 лет назад +1

    awesome sir

  • @AnkitSoni-vm5od
    @AnkitSoni-vm5od 7 лет назад

    sir upload an video on dynamic problem;- Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.

  • @kirankumarmv2771
    @kirankumarmv2771 4 года назад

    HI Vivek,
    Can you please post the code for deletion of a node from BST?

  • @cricket9560
    @cricket9560 4 года назад

    sir what if the user given a node which is a leaf node what will be the algo for this condition??

  • @anjurawat9274
    @anjurawat9274 4 года назад

    this video honestly deserves like

  • @monishajv7571
    @monishajv7571 6 лет назад

    Excellent Explanation

  • @NareshKumar-dw9xp
    @NareshKumar-dw9xp 5 лет назад

    Best explanation as always. Keep it up 👍

  • @PritamKumar-mr5dv
    @PritamKumar-mr5dv 3 года назад

    best video i ever seen.....

  • @shivasri4112
    @shivasri4112 4 года назад

    You are the best 🍁

  • @asokanramasamy2087
    @asokanramasamy2087 6 лет назад

    Nice explanation!!
    What will be the inorder successor for 105 in this example?

    • @khaledsaleh4238
      @khaledsaleh4238 6 лет назад

      Successor means the next higher value right? so for 105 there is no successor as this is the max value of that tree.

    • @mitcho426
      @mitcho426 6 лет назад

      if store pointer is null that means there was no left turns made, thus no inorder successor.

  • @newanurag
    @newanurag 6 лет назад +1

    If we have to find the inorder successor of last node i.e. 105, then can we assume that if there is no left turn happened during the search path of node 105 then there is no successor. Kindly suggest.

  • @satheshbm92
    @satheshbm92 4 года назад +1

    Amazing explanation, That was a tough one :)

  • @9900shreyas
    @9900shreyas 4 года назад

    Great Explanation. Respect!

  • @sumitnaik1990
    @sumitnaik1990 6 лет назад

    Like array tutorial do have any tutorial for Strings related question

  • @bisuk1983
    @bisuk1983 6 лет назад

    very good explanation

  • @ShreyaSingh-vr9qi
    @ShreyaSingh-vr9qi 4 года назад

    What if inorder succesor does not exist, suppose given node is root node and there is no right subtree for it.

  • @aungthiha9443
    @aungthiha9443 3 года назад +1

    Thank u sir

  • @prinkakumari8018
    @prinkakumari8018 5 лет назад

    please make video on red-black tree.

  • @KnowledgeGuide859
    @KnowledgeGuide859 6 лет назад

    Hi Vivekananda,
    Can you please upload the video for finding all nodes at a distance k from a target node

    • @HIMANSHUCHHABRA9304
      @HIMANSHUCHHABRA9304 6 лет назад

      Run BFS it gives you the shortest natural distance from starting node, keep track of the distance, you can use DFS too but BFS will be easier

    • @KnowledgeGuide859
      @KnowledgeGuide859 6 лет назад

      HIMANSHU CHHABRA thanks . I will try it out.

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 6 лет назад

    If we had a parent pointer could we just do if(current node == left child of parent) then return that for case 2?

    • @paullee1171
      @paullee1171 6 лет назад

      Yeah I was thinking the same thing. If we had a pointer where if (currentNode TAG == 0) then just return that Link which would be the Successor, i.e. the Parent

    • @foo.1396
      @foo.1396 6 лет назад

      May be.

  • @elijaheinstein160
    @elijaheinstein160 7 лет назад

    Awesome explanation ! Thanks !

  • @agyatanonymous3995
    @agyatanonymous3995 6 лет назад

    Not a single dislike! Awesome!

  • @tommykebede8895
    @tommykebede8895 6 лет назад

    nice explanation
    can we also use stack ?

    • @princebaweja4752
      @princebaweja4752 5 лет назад

      yeah sure...but without using stack u r able to solve this....then why do u want to use stack..

  • @AdeshPaul
    @AdeshPaul 5 лет назад

    Many Thanks

  • @muhsin98
    @muhsin98 Год назад

    Thanks 🙏 😊

  • @ajvindersingh6835
    @ajvindersingh6835 3 года назад

    Thank u sir ♥️

  • @krishnodas6678
    @krishnodas6678 2 года назад

    can I achieve this through recursion

  • @meditationandrelaxationmus741
    @meditationandrelaxationmus741 5 лет назад

    Can you please show how to convert roman number to number was a interview question..

  • @thinkindependently138
    @thinkindependently138 7 лет назад

    I would appreciate if you can show your code for case 2. Thank you.

    • @vivekanandkhyade
      @vivekanandkhyade  7 лет назад

      yes sure...i have written the code on board ...but did not explain...will make a video on code explanation

  • @sumanthkumarkhajjayam6025
    @sumanthkumarkhajjayam6025 6 лет назад

    can you do video on
    splay trees

  • @muzamilmehraj2529
    @muzamilmehraj2529 Год назад

    what about if it is an alphabets

  • @MohitSingh-em1nk
    @MohitSingh-em1nk 5 лет назад

    Thanks sir

  • @foo.1396
    @foo.1396 6 лет назад +1

    10:19
    Great Explanation tho. (Y)

  • @PraveenKumar-ft2kr
    @PraveenKumar-ft2kr 6 лет назад

    Thank you 😀😁

  • @harshbobby1911
    @harshbobby1911 4 года назад

    Sir is video ka code kha milegea
    Muje code cahhiye sir pls

  • @prajakta_patil
    @prajakta_patil 5 лет назад

    thanks

  • @theprshntaggrwl
    @theprshntaggrwl 4 года назад

    you can ask me in comments, and I will never reply.. because he has not replied to any of the comment.

  • @rahulraj28raj
    @rahulraj28raj 3 года назад

    bhai ek request hai apse please hindi me bol liya kijiye..english teak se explain nai kr pa rhe ho ap

  • @sachinbhalla14
    @sachinbhalla14 5 лет назад

    Where is The Source Code

  • @reassume4826
    @reassume4826 6 лет назад

    Gem.

  • @vishalkumarchoudhary9433
    @vishalkumarchoudhary9433 5 лет назад

    16:30 also say that first untraversed parent

  • @kansiram5340
    @kansiram5340 7 лет назад

    sir upload graph

  • @sachinbhalla14
    @sachinbhalla14 5 лет назад

    This Logic is Not Working in all Cases

  • @payalsagar1808
    @payalsagar1808 4 года назад

    wuah😃

  • @harriskhawar7901
    @harriskhawar7901 5 лет назад

    are you single? ;)

  • @shrabanakumar7754
    @shrabanakumar7754 4 года назад

    very good explanation