Depth First & Tree Traversals (Pre, In, Post) Explained
ฝัง
- เผยแพร่เมื่อ 27 พ.ค. 2024
- In this video, we provide a walkthrough depth-first traversals of trees both iteratively and recursively and explore the differences across pre-order, in-order, and post-order traversals.
Highlights:
0:15 Learning Objectives
0:30 Depth-first traversal conceptual overview
5:30 Implementing depth-first traversal using a stack
9:58 Time and space complexity
10:50 Recursive implementation of depth-first traversal
15:31 Pre-order traversals
17:30 Post-order traversals
18:24 In-order traversals
20:12 Problem: summing a tree
28:14 Recap
Check out our video series on Data Structures & Algorithm fundamentals where we cover Big O, recursion & more: bit.ly/algorithm-fundamentals-...
To access hundreds of real coding challenges on algorithms, React, SQL, and more along with nearly one million solutions, visit coderbyte.com/.
Participate in our weekly coding challenge series at bit.ly/weekly-coding-challenges
Stay up to date with interview prep tips and hiring trends at / coderbyte - วิทยาศาสตร์และเทคโนโลยี
Alvin's explanations are so easy to understand, its been months since new content has come out on this channel. I hope he's cooking up some new content. Graph theory/Greedy algorithms would be awesome
Hey Alvin, really enjoyed your dynamic programming course. I love the way you explain stuff. Thank you for what you do.
No prob. Excited to hear that it was useful. -Alvin
Hello Alvin.. I watched your Dynamic Programming video(from freecodecamp). I really love the way you explain different concepts. Do create more videos on computer science basics, algorithm and design.
Thank you so much.🙏🏽
Hey Alvin, just finished watching all your videos. You’re lectures/demos are by far the best out there! As a budding self-taught programmer, you’ve helped immensely in my understanding of data structures and algorithms. I hope there’s more in the works!!
I love your interjections of saying things like "just for funsies" 😆 it really brings some comedic relief to an otherwise intense algorithmic challenge for those of us just getting acclimated to this sort of thing. You're a breath of fresh ADS air on youtube!
I have been struggling to get my head round how the post, pre and inline are connected. You made it so easy to understand. Thank you
Alvin is the best!!! he deserves so many more views like his dynamic programming video. He is a GOAT
Easily the best channel in the space, better than every other YT channel atm
Been reviewing my data structures and these videos are excellent. I appreciated two things especially in this video: @4:40 a brief review of how the binary tree is constructed so I didn't have to go back to the previous video and @24:50 the stepping through of that tricky recursive algorithm.
The Pre, In, Post explanation is really clear enough and easily understand. Thanks dude.
Please do a video on greedy algos and have the differ from DP
Oh my goodness! Can you make videos about ALL data structures and algorithms?? Concepts that just haven't "clicked" for me are finally making sense thanks to your amazing, concise teaching style. I just completed your freeCodeCamp video on trees and it was AWESOME!
Thanks Alvin! Very clean & clear explanations. Please don't stop making more videos.
Awesome explanation! Waiting for your next videos
Your video on dp was very good please consider covering more advanced dp problems, and also make videos in general too.
wow, simple, concise and clear
thank you alvin :)
Honestly, his explanation is very good. What I tried to understand but couldn't even after trying 2 continuous days, I understood it just within a few minutes with his explanation.
Thanks for this excellent explanation!
this explanation is waay better
thank you
Your explanation is very helpful. I like the way you used the stack object for the depth first approach. Thank you.
Came here from freecodecamp.org. Awesome explanations!! Subscribed.
Thanks for watching!
Depth First traversal is very well explained with nice visualization
Amazing Explanation. Amazing
Thank You Very much for such amazing vedios .....I really liked ur Dynamic Programming course.....
Looking forward for more vedios..
Thanks again :)
You just saved me soo much time. Thank you
Here after your Dynamic programming video on @freecodecamp.org .It was Awesome ,Thank you very much for the Knowledge. Subscribed!!
Welcome aboard! -Alvin
Good explanation!
These slides are awesome. Which platform do you use for creating these beautiful slides? Excellent content btw.
Thank you!
That was AMAZING !! , Really liked the video , the content , how you explain , literally EVERYTHING was perfect !!. My only comment is that I want you to solve real problems.
Thanks so much!
HI Alvin, it has been a while since you did not make an new videos on tress.... please consider making videos on avl and red black tree which are self balancing as you know.
What software do u use for your diagrams/drawings?
A1 content!
DFS is same as pre-order? and please make more videos!!
sir ur explanation is very well. please do program in c/c++. because so many students will be teached c/c++ in college. so it will be so helpful if u change ur programming language.
how does the tree recursively goes back to the parent after it reaches null in a node?
Here from @freecodecamp.org , I'm hooked to your style of teaching , already subscribed!! waiting for this series to continue on to graphs as well!
Glad to hear you are finding value in the content! -Alvin
🙌💯
why youTube take too much months to recommend this playlist
How you handle a tree that wasn't binary? Let's say you had 4 children of a node.