INORDER SUCCESSOR in binary search tree[CODE Explained]

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Find INORDER SUCCESSOR in binary search tree.

КОМЕНТАРІ • 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 5 місяців тому

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

  • @d0minar
    @d0minar 4 роки тому +7

    Probably the only explanation on UA-cam that is perfectly clear. Thank you my friend!

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

  • @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.

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

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

  • @abirhossainrohan8067
    @abirhossainrohan8067 5 років тому +1

    sir explanation is really great

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

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

  • @gurjarc1
    @gurjarc1 6 років тому

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

  • @TharaMesseroux1
    @TharaMesseroux1 2 роки тому +1

    Thank you, Vivekanand! We appreciate you!

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

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

  • @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?

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

    very great explanations sir

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

    Best explanation on the web. Thanks!!

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

    One of the best explanation

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

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

  • @sunnyjain630
    @sunnyjain630 6 років тому

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

  • @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 .

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

  • @m.mubashar786
    @m.mubashar786 3 роки тому

    very nice explaining sir....You rocked

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

    Very helpful, especially explanation with example

  • @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.

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

    u r amazing .. hope you land the best companies

  • @linonator
    @linonator Рік тому

    This was a really good explanation. Thanks a lot

  • @kabboghosh1853
    @kabboghosh1853 5 років тому +1

    awesome sir

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

  • @cindy0092
    @cindy0092 5 років тому +2

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

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

    awesome Sirji!

  • @채서영-d4l
    @채서영-d4l 4 роки тому

    BEST explanation I've ever seen

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

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

    very good explanation

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

    nice explanation. thank you.

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

    awesome explaination

  • @PritamKumar-mr5dv
    @PritamKumar-mr5dv 3 роки тому

    best video i ever seen.....

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

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

    You are the best 🍁

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

    Thank you, this was the best material on the topic

  • @nirmaljingar
    @nirmaljingar 5 років тому

    Hi Vivekanand, great explanation! I am really impressed. Can you please create a separate video on Big O and Time Complexity?

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

    this video honestly deserves like

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

    Excellent, thank you.

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

    Thanks a lot for explaining so beautifully.

  • @chandanagp3960
    @chandanagp3960 6 років тому

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

  • @abbasikov
    @abbasikov 6 років тому

    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 6 років тому

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

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

    Amazing explanation, That was a tough one :)

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

    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.

  • @NareshKumar-dw9xp
    @NareshKumar-dw9xp 5 років тому

    Best explanation as always. Keep it up 👍

  • @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.

  • @monishajv7571
    @monishajv7571 6 років тому

    Excellent Explanation

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

    Thank u sir

  • @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.

  • @9900shreyas
    @9900shreyas 4 роки тому

    Great Explanation. Respect!

  • @agyatanonymous3995
    @agyatanonymous3995 6 років тому

    Not a single dislike! Awesome!

  • @elijaheinstein160
    @elijaheinstein160 6 років тому

    Awesome explanation ! Thanks !

  • @sachinshet6285
    @sachinshet6285 5 років тому

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

  • @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.

  • @swornimbaral9176
    @swornimbaral9176 6 років тому

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

  • @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.

  • @foo.1396
    @foo.1396 6 років тому +1

    10:19
    Great Explanation tho. (Y)

  • @muhsin98
    @muhsin98 Рік тому

    Thanks 🙏 😊

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

    Thank u sir ♥️

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

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

  • @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.

  • @sumitnaik1990
    @sumitnaik1990 6 років тому

    Like array tutorial do have any tutorial for Strings related question

  • @AdeshPaul
    @AdeshPaul 5 років тому

    Many Thanks

  • @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.

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

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

  • @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.

  • @MohitSingh-em1nk
    @MohitSingh-em1nk 5 років тому

    Thanks sir

  • @PraveenKumar-ft2kr
    @PraveenKumar-ft2kr 6 років тому

    Thank you 😀😁

  • @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..

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

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

  • @prajakta_patil
    @prajakta_patil 5 років тому

    thanks

  • @reassume4826
    @reassume4826 6 років тому

    Gem.

  • @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 5 років тому

    can you do video on
    splay trees

  • @muzamilmehraj2529
    @muzamilmehraj2529 Рік тому

    what about if it is an alphabets

  • @meditationandrelaxationmus741
    @meditationandrelaxationmus741 5 років тому

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

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

    can I achieve this through recursion

  • @vishalkumarchoudhary9433
    @vishalkumarchoudhary9433 5 років тому

    16:30 also say that first untraversed parent

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

    wuah😃

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

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

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

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

  • @kansiram5340
    @kansiram5340 7 років тому

    sir upload graph

  • @sachinbhalla14
    @sachinbhalla14 5 років тому

    Where is The Source Code

  • @sachinbhalla14
    @sachinbhalla14 5 років тому

    This Logic is Not Working in all Cases

  • @harriskhawar7901
    @harriskhawar7901 5 років тому

    are you single? ;)

  • @bisuk1983
    @bisuk1983 5 років тому

    very good explanation