/ 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.
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.
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.
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.
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!!!
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.
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.
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!
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.
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?
came here when I didn't get the geeksforgeeks explanation. you have explained it lucidly.
I came like that as well. Lol!
same her bro..
Me too
Me too :-)
Me too:}
Good luck to everyone working hard to be at good tech companies. Thank you for the explanation.
so nice 😊
Thank you Tushar! Your video is always a guarantee of crystal clarity. Kudos!
Thank you! This was the best explanation I found. Instead of going straight into algorithm, Tushar explained the thought behind it. Great job.
Man I spent like 2 hours trying to understand the code, but visually seeing it step by step made it finally make sense, thanks!
OK man
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.
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.
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.
Out of all Morris algorithm explanations out there, yours is so much better. Thank you!
Thank you! This is the most thorough video explanation on Morris Traversal that I have been able to find.
Best explanation ever. Better than pepcoding, better than Striver.
Same thoughts
Almost I gave my 2 hours to understand this algorithms on others channel but when I watched this video I got it. Great explanation.
Best person to explain complex topics. I wonder why his channel is not very famous?
I am very thankful for your clear explanation and pronunciation!
Thanks tushar For explaining in simple manner with algorithm and code.
i really appreciate the hard work to teach us thank you
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!!!
The best video about morris! Love your video!
You explain very well. Thank you
Amazing explanation man, props to you!
Loved your explanation
The best explanation I found on youtube so far
Thank you for all your videos :)
Great, very intuitive and explanative
Precise and sweet explanation. thanks :)
Explanation was very nice , thanks for the vid :D
Thank you very much for the clear explanation.
his diagram is clean and clear enough to demonstrate the concept
Awesome explanation, made this complex algo smooth.
Explanation is Awesome !
Super good explanations!
Best explanation of Morris traversal on the internet
Thank You Tushar.. Nice explanation. It really helped me.
Awesome! Thank you Tushar!! :D
Nicely explained. Thanks!
Awesome man... Nice explanation
Great walkthrough, thank you!
Thank you for your explanation.
awesome explanation Much much better than Geeks for geeks
Excellent explanation !!
Man, you are always so helpful explaining those fancy algorithms.
Very Good Explanation Thanks
your speaking is way better than others
Thanks, best video on this algorithm!
Great explaination!
A+++++ explanation. Really appreciate it!
Excellent explanation!
Nice explanation!
Amazing as always!!
Thanks a lot!
Great explanation
very well explained..thank you so much
Very good explanation!!
Dude, you're awesome. Thank you for these videos.
Very nice explanation 🙌🙌
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.
really made it easy to understand
Thanks so much for making my life easier!!!
thanks, sir really nice explanation....!
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.
That's great explanation!
Nice explained♥️
very clear, thank you so much
Nice explanation sir...
Excellent video
Great video! Thanks.
thanks for the explanation
clean algorithm, beautifully explained. thank you so much!
Thanks for your explanation! I was confused about Morris Traversal, but you video make me clear now.
Nice explanation
Nice Explanation
Thank you great explanation
very clear thank you so much
awesome stuff mate..awesome
nice explanation..thank u sir
nice explanation
Thanks Tushar ! :)
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!
could you please make similar videos for Morris traversal for priorder and post order traversal
Good Explanation. :)
Very clear!
Thank you!
Thank You
nice explanation!
That was amazing
nice video!
I love this guy
how is the time complexity O(n)... we are revisiting nodes in a loop many times...
Great Explanation sirji...
Good Explanation
Thanks for this
what a beautiful algorithm!!
I've watched this like 10 times xD
Great Video
God bless u.. So much :)
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.
The TC will still be 2N which is O(N) as the nodes visited at max twice.
thank you for the video!! but at 7:27 current = current.right, but you were pointing to the wrong place on the white board.
Will the algorithm work if we have duplicate elements in the tree?
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
Explanation is excellent , simple request is to talk at steady pace. a bit slower ...then it will be much easier to absorb :)
Talk about an elegant algorithm.
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?
Nevermind, we need that if statement to see if we establish a link to a "current" node