Morris Inorder Tree Traversal

Sdílet
Vložit
  • čas přidán 20. 07. 2024
  • / tusharroy25
    github.com/mission-peace/inte...
    github.com/mission-peace/inte...
    Inorder iterative traversal of a binary tree without stack or recursion. This traversal is called Morris traversal.

Komentáře • 216

  • @sidharthbihary2475
    @sidharthbihary2475 Před 5 lety +215

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

  • @alexnice2221
    @alexnice2221 Před 5 lety +276

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

  • @mierta7751
    @mierta7751 Před 2 lety +6

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

  • @gooomarco
    @gooomarco Před 3 měsíci +2

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

  • @jubjubfriend64
    @jubjubfriend64 Před 4 lety +28

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

  • @himanshusharma7417
    @himanshusharma7417 Před 8 lety +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.

  • @shwetayadav5256
    @shwetayadav5256 Před 5 lety +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.

  • @bewareofnikhil
    @bewareofnikhil Před 2 lety +2

    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.

  • @roman_mf
    @roman_mf Před rokem +1

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

  • @aaronschwartz-messing4701

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

  • @Virtualexist
    @Virtualexist Před rokem +8

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

  • @rajankhunt7002
    @rajankhunt7002 Před rokem +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.

  • @abhaypatil2000
    @abhaypatil2000 Před 4 lety

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

  • @mishapetin4386
    @mishapetin4386 Před rokem

    I am very thankful for your clear explanation and pronunciation!

  • @ShabnamKhan-cj4zc
    @ShabnamKhan-cj4zc Před 7 lety +1

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

  • @ankithas1868
    @ankithas1868 Před 4 lety

    i really appreciate the hard work to teach us thank you

  • @user-vr2go1bj5b
    @user-vr2go1bj5b Před 12 dny

    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!!!

  • @shuxuannie1470
    @shuxuannie1470 Před 7 lety +2

    The best video about morris! Love your video!

  • @anhminhtran7436
    @anhminhtran7436 Před 5 lety

    You explain very well. Thank you

  • @sachin_yt
    @sachin_yt Před 2 lety

    Amazing explanation man, props to you!

  • @amanbhadauria2881
    @amanbhadauria2881 Před 3 lety

    Loved your explanation

  • @manasranjan7894
    @manasranjan7894 Před rokem

    The best explanation I found on youtube so far

  • @tanujabharti8043
    @tanujabharti8043 Před 4 lety

    Thank you for all your videos :)

  • @weilihe8989
    @weilihe8989 Před 3 lety

    Great, very intuitive and explanative

  • @nabidulalam6956
    @nabidulalam6956 Před 3 lety

    Precise and sweet explanation. thanks :)

  • @VipinChaudhary14119
    @VipinChaudhary14119 Před 6 lety +1

    Explanation was very nice , thanks for the vid :D

  • @udemycourse4435
    @udemycourse4435 Před 3 lety

    Thank you very much for the clear explanation.

  • @neerajchoudhary3709
    @neerajchoudhary3709 Před 2 lety

    his diagram is clean and clear enough to demonstrate the concept

  • @nitinadarsh
    @nitinadarsh Před 4 lety

    Awesome explanation, made this complex algo smooth.

  • @Nampjg
    @Nampjg Před 3 lety

    Explanation is Awesome !

  • @utkarshtiwari7738
    @utkarshtiwari7738 Před 2 lety

    Super good explanations!

  • @blacktrojan3313
    @blacktrojan3313 Před 3 lety

    Best explanation of Morris traversal on the internet

  • @sanjayizardar2263
    @sanjayizardar2263 Před 8 lety

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

  • @sammyiboi
    @sammyiboi Před 6 lety +2

    Awesome! Thank you Tushar!! :D

  • @dhruvsethut
    @dhruvsethut Před 8 lety

    Nicely explained. Thanks!

  • @uwaismanzoor
    @uwaismanzoor Před 3 lety

    Awesome man... Nice explanation

  • @Mel-jp5vb
    @Mel-jp5vb Před rokem

    Great walkthrough, thank you!

  • @tolerancepark4087
    @tolerancepark4087 Před 6 lety

    Thank you for your explanation.

  • @pulkitnijhawan1059
    @pulkitnijhawan1059 Před 5 lety

    awesome explanation Much much better than Geeks for geeks

  • @shiveshdixit1640
    @shiveshdixit1640 Před 3 lety

    Excellent explanation !!

  • @YongboLi
    @YongboLi Před 6 lety +2

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

  • @HaiderAli-nn3gy
    @HaiderAli-nn3gy Před rokem

    Very Good Explanation Thanks

  • @reconnect10
    @reconnect10 Před 4 lety

    your speaking is way better than others

  • @kfliden
    @kfliden Před 3 lety

    Thanks, best video on this algorithm!

  • @user-oq6jg3gl8k
    @user-oq6jg3gl8k Před 3 lety

    Great explaination!

  • @gg142000
    @gg142000 Před rokem

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

  • @scotthall6005
    @scotthall6005 Před 8 lety

    Excellent explanation!

  • @tusharsinha313
    @tusharsinha313 Před 7 lety +1

    Nice explanation!

  • @VishalSharma-hq5ti
    @VishalSharma-hq5ti Před 4 lety

    Amazing as always!!

  • @MrRantelo
    @MrRantelo Před 6 lety

    Thanks a lot!
    Great explanation

  • @uttamnandi124
    @uttamnandi124 Před 7 lety +1

    very well explained..thank you so much

  • @vartikapriyadarshini4511
    @vartikapriyadarshini4511 Před měsícem

    Very good explanation!!

  • @niranjanprithviraj
    @niranjanprithviraj Před 8 lety +2

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

  • @omkarrasal1395
    @omkarrasal1395 Před 2 lety

    Very nice explanation 🙌🙌

  • @panchajanya1967
    @panchajanya1967 Před 5 měsíci

    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.

  • @nikhilrathore2385
    @nikhilrathore2385 Před 5 lety

    really made it easy to understand

  • @Lisa-kk6go
    @Lisa-kk6go Před 4 lety

    Thanks so much for making my life easier!!!

  • @lovekeshmadaan2767
    @lovekeshmadaan2767 Před 5 lety

    thanks, sir really nice explanation....!

  • @cameronswartzell5251
    @cameronswartzell5251 Před rokem

    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.

  • @tomtao4991
    @tomtao4991 Před 3 lety

    That's great explanation!

  • @pluviophile762
    @pluviophile762 Před 4 lety

    Nice explained♥️

  • @tanloc1273
    @tanloc1273 Před 2 lety

    very clear, thank you so much

  • @paragroy5359
    @paragroy5359 Před 3 lety +1

    Nice explanation sir...

  • @adityapasari2548
    @adityapasari2548 Před 7 lety

    Excellent video

  • @jianingzhuang104
    @jianingzhuang104 Před 5 lety

    Great video! Thanks.

  • @kartikeydixit3743
    @kartikeydixit3743 Před 3 lety

    thanks for the explanation

  • @sarastanway8861
    @sarastanway8861 Před 5 lety +2

    clean algorithm, beautifully explained. thank you so much!

  • @nancyli8313
    @nancyli8313 Před 5 lety +1

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

  • @SachinSingh-im2qm
    @SachinSingh-im2qm Před 3 lety

    Nice explanation

  • @adityatrived.i
    @adityatrived.i Před 4 lety

    Nice Explanation

  • @sarramarmouche8344
    @sarramarmouche8344 Před měsícem

    Thank you great explanation

  • @cartersuppes9434
    @cartersuppes9434 Před 10 měsíci

    very clear thank you so much

  • @mridulmittal5953
    @mridulmittal5953 Před 5 lety

    awesome stuff mate..awesome

  • @coderajput1816
    @coderajput1816 Před 6 lety

    nice explanation..thank u sir

  • @HarshNigamhello
    @HarshNigamhello Před 4 lety

    nice explanation

  • @madhumithakarthikeyan1877

    Thanks Tushar ! :)

  • @StartWithShikhorRoy
    @StartWithShikhorRoy Před 2 lety

    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!

  • @sureshgarine
    @sureshgarine Před 6 lety

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

  • @sakshi6095
    @sakshi6095 Před 2 lety

    Good Explanation. :)

  • @FrankZChen
    @FrankZChen Před 11 měsíci

    Very clear!

  • @freesoul2677
    @freesoul2677 Před 2 lety

    Thank you!

  • @ganapatibiswas5858
    @ganapatibiswas5858 Před 3 lety +1

    Thank You

  • @rusenyan4021
    @rusenyan4021 Před 4 lety

    nice explanation!

  • @jatingupta5986
    @jatingupta5986 Před 4 lety

    That was amazing

  • @nitingupta1417
    @nitingupta1417 Před 3 lety

    nice video!

  • @houseisforthesoul
    @houseisforthesoul Před rokem

    I love this guy

  • @chiraglosalka6893
    @chiraglosalka6893 Před 8 lety

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

  • @karthikeyy
    @karthikeyy Před 8 lety

    Great Explanation sirji...

  • @nagarohitkatta3830
    @nagarohitkatta3830 Před 5 lety

    Good Explanation

  • @albertagram
    @albertagram Před 7 lety

    Thanks for this

  • @lokesh-qz6cc
    @lokesh-qz6cc Před 4 lety

    what a beautiful algorithm!!

  • @BlueBunnyGamer
    @BlueBunnyGamer Před 6 lety +9

    I've watched this like 10 times xD

  • @siliyang2700
    @siliyang2700 Před 8 lety

    Great Video

  • @shubhamsingh-nt9mm
    @shubhamsingh-nt9mm Před 5 lety

    God bless u.. So much :)

  • @anmoljain5910
    @anmoljain5910 Před 4 lety

    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 Před rokem

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

  • @erniethenyctabby2915
    @erniethenyctabby2915 Před 4 lety +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.

  • @jineshdhruv6151
    @jineshdhruv6151 Před 6 lety

    Will the algorithm work if we have duplicate elements in the tree?

    • @amithrc3026
      @amithrc3026 Před 6 lety

      if you are using Trees to implement map data structure which does not allow duplicate,do not insert the duplicate element at the first place

  • @anandkulkarni2111
    @anandkulkarni2111 Před 5 lety

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

  • @morelfotsing2221
    @morelfotsing2221 Před 5 lety

    Talk about an elegant algorithm.

  • @fahrankamili7931
    @fahrankamili7931 Před 6 lety

    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 Před 6 lety

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