Morris Inorder Tree Traversal - Iterative Inorder Tree Traversal Algorithm

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 31

  • @bhavulgauri7832
    @bhavulgauri7832 Před 4 lety

    Good job bro. Thanks a lot. Publish more videos, you explain well. With a month or so of videos you may reach thousands of subscribers. :)

  • @ashishbehl3498
    @ashishbehl3498 Před 4 lety +1

    Good video brother. Waiting for more.

  • @pawandeepchor89
    @pawandeepchor89 Před 3 lety

    Awesome expalantion, thanks (y)

  • @payalsagar1808
    @payalsagar1808 Před 4 lety

    nice explanation!
    all the best😊

  • @gururajannarasimhan8293

    great video,Nice way of explaining.

  • @decodingParinda
    @decodingParinda Před 4 lety

    Awesome explanation, thanks brother :)

  • @deeptikatyal5120
    @deeptikatyal5120 Před 4 lety

    great explanation ....very helpful .. GOOD JOB! :D

  • @bharatprakashparakh9601

    Superb brother !

  • @zummotv1013
    @zummotv1013 Před 4 lety +1

    hi Karthik, good content, please do videos on DP, greedy, graphs etc

  • @maxvandoorn3040
    @maxvandoorn3040 Před 4 lety

    Thanks man, great vid

  • @daniskhan
    @daniskhan Před 4 lety

    thanks brother

  • @sanfenli
    @sanfenli Před rokem

    😢sorry ,why we need to set predecessor->right = Null

  • @DACS_DEEPAKSINGH
    @DACS_DEEPAKSINGH Před 4 lety +1

    Can you make a tell me how you became so good in competitive programming.
    I am so bad at it.

  • @zhouchong90
    @zhouchong90 Před 4 lety +2

    Good video but how to find predecessor?

    • @karthikchennupati6177
      @karthikchennupati6177  Před 4 lety

      checkout the findPredecessor() function here - github.com/chkarthik1729/Programming-Practice/blob/master/Data%20Structures/Trees/MorrisInorderTreeTraversal.c

    • @rishabhbhatnagar6795
      @rishabhbhatnagar6795 Před 4 lety

      maximum from the left subtree.

  • @DACS_DEEPAKSINGH
    @DACS_DEEPAKSINGH Před 4 lety +1

    Bro why are you not making morr video

  • @bloodmad3214
    @bloodmad3214 Před 4 lety +3

    Great explanation but plz just speak not so hurriedly.

  • @kanna6115
    @kanna6115 Před 4 lety

    13 is coming after 11, so 13 is successor of 11 right? why we say as predecessor. I mean, i dont know just want to clarify it.

    • @karthikchennupati6177
      @karthikchennupati6177  Před 4 lety

      Before visiting 13, we're checking whether there is anything in the left tree. If there is, the entire left subtree needs to be processed before we process 13. The last node in the left subtree that will be processed is it's inorder predecessor, 11. So, we think in terms of predecessor.

  • @RaviTejaVanjarapu
    @RaviTejaVanjarapu Před rokem

    Good explaination but you're talking so fast (like me :P) . Had to rewind multiple times.

  • @gurupreetsingh8347
    @gurupreetsingh8347 Před 4 lety

    why we are removing links after visiting , what will happen if we doesn't remove it.........?

    • @karthikchennupati6177
      @karthikchennupati6177  Před 4 lety +1

      If we modify the tree, any further operations on the tree would not behave as expected.

    • @gurupreetsingh8347
      @gurupreetsingh8347 Před 4 lety

      @@karthikchennupati6177 what would be the time complexcity of this algo ?

    • @karthikchennupati6177
      @karthikchennupati6177  Před 4 lety

      Time Complexity: O(n) - The control gets passed onto any node atmost twice. (1. Initially and 2. After processing left subtree)

  • @shikharsharma3980
    @shikharsharma3980 Před 3 lety

    If we are calculating predecessor on the fly,
    and we know predecessor is the right most element in the left subtree,
    so when we check for condition predecessor -> right exist don't you think we will get the root node as predecessor as we earlier pointed right of predecessor to root,
    as a result of which when we find predecessor second time , right most node of the left subtree will be the root as we made a connection from prev_pred and root node.
    in short the predecessor we get first time and the predecessor we get after we have made connection will be different.
    If i was't clear reply and ill try to explain with examples

    • @ikeshyadav8226
      @ikeshyadav8226 Před 3 lety

      I would assume that the function find predecessor makes a check to see if the predecessor found==current, as mentioned in this article www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/

  • @abhinavpriyadarshi5117

    bhai why so angry