Morris Inorder Tree Traversal

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

КОМЕНТАРІ • 220

  • @alexnice2221
    @alexnice2221 5 років тому +288

    Good luck to everyone working hard to be at good tech companies. Thank you for the explanation.

  • @sidharthbihary2475
    @sidharthbihary2475 6 років тому +216

    came here when I didn't get the geeksforgeeks explanation. you have explained it lucidly.

  • @Virtualexist
    @Virtualexist Рік тому +9

    Best explanation ever. Better than pepcoding, better than Striver.

  • @kayysean99
    @kayysean99 29 днів тому

    You never fail to impress. Your explanations are always crystal clear and easy to understand. Thanks for sharing your knowledge!!

  • @jubjubfriend64
    @jubjubfriend64 4 роки тому +30

    Man I spent like 2 hours trying to understand the code, but visually seeing it step by step made it finally make sense, thanks!

  • @roman_mf
    @roman_mf Рік тому +2

    Out of all Morris algorithm explanations out there, yours is so much better. Thank you!

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

    I have skipped Morris Traversal for the past 7 years because I never understood it. Turns out, I only had to watch this 10 minute clip. Thanks a ton man.

  • @gooomarco
    @gooomarco 7 місяців тому +2

    Thank you! This was the best explanation I found. Instead of going straight into algorithm, Tushar explained the thought behind it. Great job.

  • @rajankhunt7002
    @rajankhunt7002 Рік тому +1

    Almost I gave my 2 hours to understand this algorithms on others channel but when I watched this video I got it. Great explanation.

  • @mierta7751
    @mierta7751 3 роки тому +6

    Thank you Tushar! Your video is always a guarantee of crystal clarity. Kudos!

  • @aaronschwartz-messing4701
    @aaronschwartz-messing4701 5 місяців тому

    Thank you! This is the most thorough video explanation on Morris Traversal that I have been able to find.

  • @JIHYELEE-h2m
    @JIHYELEE-h2m 4 місяці тому

    Wow the intro is so good!! now I understand why thread(link) is needed! bc we have to come back root, without stack or recursion! wow Thanks my teacher!!!

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

    It’s a good explanation for those looking in to the problem already and stuck with solving it. For those looking in to the problem first time, it would help if the pace of explanation is bit slower.

  • @himanshusharma7417
    @himanshusharma7417 8 років тому +2

    Hi Tushar. I want to thank you for this video. I looked at almost all sources that explain morris traversal but yours actually made everything clear in my mind. Keep making more videos like this. Thanks again.

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

    his diagram is clean and clear enough to demonstrate the concept

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

    There's a LOT of bad articles poorly explaining this, and I gave up after checking a few. This cleared it up pretty quickly. I do wish in his first pass he hadnt abstracted findPredecessor() into some invisible function.

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

    Best person to explain complex topics. I wonder why his channel is not very famous?

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

    The best explanation I found on youtube so far

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

    Best explanation of Morris traversal on the internet

  • @ShabnamKhan-cj4zc
    @ShabnamKhan-cj4zc 7 років тому +1

    Thanks tushar For explaining in simple manner with algorithm and code.

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

    I am very thankful for your clear explanation and pronunciation!

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

    your speaking is way better than others

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

    awesome explanation Much much better than Geeks for geeks

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

    Excellent explanation of Morris Algorithm !! keep up the good wrk Tushar !! I keenly follow your videos and they are immensely helpful in understanding concepts of Compute rScience.

  • @pelinavsar4498
    @pelinavsar4498 Місяць тому

    Beautifully explained, thank you. Subbed.

  • @shuxuannie1470
    @shuxuannie1470 8 років тому +2

    The best video about morris! Love your video!

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

    Thanks, best video on this algorithm!

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

    Nice explanation sir...

  • @YongboLi
    @YongboLi 7 років тому +2

    Man, you are always so helpful explaining those fancy algorithms.

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

    Loved your explanation

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

    Great, very intuitive and explanative

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

    A+++++ explanation. Really appreciate it!

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

    i really appreciate the hard work to teach us thank you

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

    thank you for the video!! but at 7:27 current = current.right, but you were pointing to the wrong place on the white board.

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

    Thank you very much for the clear explanation.

  • @dnyaneshwarchavan7154
    @dnyaneshwarchavan7154 6 років тому +1

    Clean and precise explanation !!

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

    Very nice explanation 🙌🙌

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

    Explanation is Awesome !

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

    I think the worst case time complexity will be O(n^2). Correct me if I am wrong. Coz we will have to find inorder predecessor for all nodes. And in case of skwed tree, it will take O(n^2) time.

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

      The TC will still be 2N which is O(N) as the nodes visited at max twice.

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

    Precise and sweet explanation. thanks :)

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

    Amazing explanation man, props to you!

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

    Awesome man... Nice explanation

  • @Mel-jp5vb
    @Mel-jp5vb 2 роки тому

    Great walkthrough, thank you!

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

    Thank you for all your videos :)

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

    Awesome explanation, made this complex algo smooth.

  • @vartikapriyadarshini4511
    @vartikapriyadarshini4511 5 місяців тому

    Very good explanation!!

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

    Thanks for your explanation! I was confused about Morris Traversal, but you video make me clear now.

  • @HaiderAli-nn3gy
    @HaiderAli-nn3gy 2 роки тому

    Very Good Explanation Thanks

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

    You explain very well. Thank you

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

    Talk about an elegant algorithm.

  • @VipinChaudhary14119
    @VipinChaudhary14119 6 років тому +1

    Explanation was very nice , thanks for the vid :D

  • @SAURAVVISHNUGITTE
    @SAURAVVISHNUGITTE 5 місяців тому

    there is a problem at 6:45 , after visiting -1 , we got to 2 , then we begin finding predecessor of 2 ,
    Alas , finding predecessor of 2 means going right most in left sub-tree of 2 ,
    here left subtree is -1 , then lets find predecessor ,-1 -> right = 2 , then 2-> right = 5 , 5-> right = 6 , 6-> right = 8 , 8 ->right = 10 , we are moving in totally different direction ....now .
    Actually this must stop when predecessor is found , but for predecessor , we keep moving right ?
    Edit: Now I saw the final code , while finding predecessor , you solved the problem by doing , predecessor-> right = current , then break .

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

    Thanks for your hard work for making such nice videos!
    But it would be great if the video explains algorithm derived from concept behind it.
    What I understand, concpet is the first thing then algo comes. You explan such a way where algo comes first then explain the concept based on the algo! Thank you!

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

    Why not to use threaded three in the first place?

  • @sanjayizardar2263
    @sanjayizardar2263 8 років тому

    Thank You Tushar.. Nice explanation. It really helped me.

  • @niranjanprithviraj
    @niranjanprithviraj 8 років тому +2

    Dude, you're awesome. Thank you for these videos.

  • @d123-y5i
    @d123-y5i 3 роки тому

    Great explaination!

  • @sarastanway8861
    @sarastanway8861 6 років тому +2

    clean algorithm, beautifully explained. thank you so much!

  • @uploadheartseexy
    @uploadheartseexy 8 років тому +9

    Tushar, Great effort on the explanation. But, it seems your algorithm on the board was incomplete (like when the predecessor->right hits the current item itself, then it should stop). Although, you do talk about it while you showcased the code. Also, When you said current becomes current-> right @7:27 , you should actually be pointing at the last else section of your algorithm.

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

      exactly, i was also confused by that pointing...

  • @uttamnandi124
    @uttamnandi124 7 років тому +1

    very well explained..thank you so much

  • @Lisa-kk6go
    @Lisa-kk6go 4 роки тому

    Thanks so much for making my life easier!!!

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

    Thank You

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

    That's great explanation!

  • @chiraglosalka6893
    @chiraglosalka6893 8 років тому

    how is the time complexity O(n)... we are revisiting nodes in a loop many times...

  • @tusharsinha313
    @tusharsinha313 7 років тому +1

    Nice explanation!

  • @sarramarmouche8344
    @sarramarmouche8344 5 місяців тому

    Thank you great explanation

  • @dhruvsethut
    @dhruvsethut 8 років тому

    Nicely explained. Thanks!

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

    Thank you for your explanation.

  • @Tommy-dd5pz
    @Tommy-dd5pz 3 роки тому

    why time complexity is O(n)?

  • @sammyiboi
    @sammyiboi 7 років тому +2

    Awesome! Thank you Tushar!! :D

  • @scotthall6005
    @scotthall6005 8 років тому

    Excellent explanation!

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

    Explanation is excellent , simple request is to talk at steady pace. a bit slower ...then it will be much easier to absorb :)

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

    good explanation, Sometimes I feel it's really helpful for yourself to understand better by presenting your idea to others

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

    Can we use this to traverse inorder reversely(right->root->left) ? ig yes ...reply if not

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

    really made it easy to understand

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

    Nice explained♥️

  • @BlueBunnyGamer
    @BlueBunnyGamer 7 років тому +9

    I've watched this like 10 times xD

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

    Thank you so much. I kept looking at an implementation and had a hard time trying to figure out what was happening. I got it now.

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

    This is much clearer than the explanation on the geekforgeeks channel.

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

    Nice explanation

  • @VishalSharma-hq5ti
    @VishalSharma-hq5ti 4 роки тому

    Amazing as always!!

  • @taotang6557
    @taotang6557 7 років тому +1

    very clear explanation!

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

    could you please make similar videos for Morris traversal for priorder and post order traversal

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

    Great video! Thanks.

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

    I love this guy

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

    Patience, friends. Bit by bit.

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

    Very well explained ... !!!!

  • @adityatrived.i
    @adityatrived.i 4 роки тому

    Nice Explanation

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

    Thanks a lot!
    Great explanation

  • @debabhishek
    @debabhishek 8 років тому

    well explained Tushar.. Just one comment for the viewers this Morris approach can be for Pre order traversal also ..and with just 1 line change in the existing code..( let it be a exercise for the viewers)

    • @debabhishek
      @debabhishek 8 років тому

      +Tushar Roy oh !! I had not seen the full video earlier.. yes its there..

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

      For Morris Postorder feel free to take a look at www.thealgorists.com/Algo/Tree/MorrisPostorder . Morris Postorder algorithm and code are beautifully explained there.

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

    thanks, sir really nice explanation....!

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

    very clear, thank you so much

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

    very clear thank you so much

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

    predecessor.right will always be null right? Because if a predecessor of a current node has a right child, then that right child is the predecessor of the current node, no?

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

      Nevermind, we need that if statement to see if we establish a link to a "current" node

  • @NihalSingh-ld2en
    @NihalSingh-ld2en 2 роки тому +1

    Don't you spit whenever you say "t"?

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

    nice explanation

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

    nice explanation!

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

    thanks for the explanation

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

    awesome stuff mate..awesome

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

    Time complexity?