Table of Contents: A Quick Message 0:00 - 0:31 What We Are Going To Do 0:31 - 0:52 Full Binary Trees 0:52 - 1:38 Complete Binary Trees 1:38 - 2:14 Perfect Binary Trees 2:14 - 3:18 Let's Discuss The 2 Fundamental Traversals 3:18 - 3:42 How To Know Which Traversal Is Which 3:42 - 5:05 Think of Recursion Like This. 5:05 - 5:33 Preorder Traversal Walkthrough 5:33 - 11:15 Inorder Traversal Walkthrough 11:15 - 14:25 We Realize That This Is A Special Tree 14:25 - 15:07 Postorder Traversal Walkthrough 15:07 - 18:59 Briefly Addressing Time Complexity 18:59 - 19:22 Wrap Up 19:22 - 19:40 At 1:42 I meant that binary heaps are complete binary trees with the heap ordering property. Not that a complete binary tree is always a heap. The code for the traversals is in the description. All recursive and basically the same function. We will do iterative and O(1) space traversals soon.
@2WARDEN25 жыл бұрын
The ToC and video itself are perfect! The quality of information is phenomenal, I'm glad I kept digging for pre/in/post order examples until I found this! Thanks for taking the time to create this!
@BackToBackSWE5 жыл бұрын
ye, for the internet yo
@bonniwanamaker62965 жыл бұрын
This guy is an amazing teacher.
@BackToBackSWE5 жыл бұрын
i try :*)
@connerjensen81704 жыл бұрын
Yeah for real I love his enthusiasm
@SquidBeats3 жыл бұрын
Jesus Christ is God and is the only way. Hell is real whether you believe it or not
@JossinJax4 жыл бұрын
Omg writing "lnr" at each node really clear this up for me. Thank you!
@BackToBackSWE4 жыл бұрын
nice
@oasishusband52603 жыл бұрын
Ikr I loved that!
@More-right-rudder3 жыл бұрын
I am a software engineer for 2 years and I didn't know that. Let me go sell my degree ...
@alexandergonzalez59755 жыл бұрын
This channel is a shiny gem among a sea of low quality CS channels. Please keep it up.
@BackToBackSWE5 жыл бұрын
haha, what a statement
@andrews29454 жыл бұрын
*Ocean of low quality CS channels
@Moitaytay5 жыл бұрын
I've gotta say; I've worked at Amazon and Lyft, where you'd think people have their fundamentals down like crazy, but they can't explain simple topics like these. You, sir, have the gift of teaching. Thanks for your help!
@BackToBackSWE5 жыл бұрын
sure
@swimmingbyrd62835 жыл бұрын
Showing these traversal with a "n" saved my lllliiiifffffeeee!!!!
@BackToBackSWE5 жыл бұрын
yuh
@backup2ramdisk Жыл бұрын
WOW. Watched a bunch of videos by different people on traversals, everyone else just mumbles on and on "print this, skip this and print that" without explaining why, and you're THE ONLY ONE who actually explains the whole recursion thing in detail. THANK YOU SO MUCH!
@prashmokk66593 жыл бұрын
This video was amazing. I don't really comment on videos, but I had to express my appreciation to you for creating this. I got an interview about a month ago and this was the first of many videos I watched of yours while I was preparing. This past week I found out that I got the job and you were a big part of that. I'm not sure if you'll see this, but I hope you know that your videos have helped me and many others. Please continue to make awesome informational content like this!
@dansteryoo4 жыл бұрын
a lot of channels would have taken shortcuts to fast-forward or just breeze by each node explanation because it might feel redundant.. but man so thankful you understand repetition is an important part of education.
@BackToBackSWE4 жыл бұрын
sure
@shenzheng21164 жыл бұрын
I am a math student targeting for a data science career And I have to say this is the BEST computer science video I have even seen! Just AMAZING!
@BackToBackSWE4 жыл бұрын
thx
@vamsishankar28254 жыл бұрын
I used to not watch this channel and ignore this channel, as it is also a channel which offers course like tech lead, joomla and others. But after watching this video, I subscribed to your channel for the most intuitive explanation given on Preorder, Inorder, & Postorder Traversal and really Loved the content.
@BackToBackSWE4 жыл бұрын
Yeah, I think we are pretty good. We have a dedication to what we do and are looking to create a service & brand with longevity and the intent to augment people's lives. I think that is something that can stand the test of time.
@andreysantos66605 жыл бұрын
Man, I wasn't being able to understand tree transversals properly until I've seen your explanation. Thanks a lot! Now I understand!
@BackToBackSWE5 жыл бұрын
nice!
@travissimelane18477 ай бұрын
I don't know how to thank you. You have saved me hours of reading a Data Structures Textbook 3 times just to get this concept. Very thankful. Please do not stop your great work
@gauravpandit5774 жыл бұрын
Wow the Video is Awesome, I had studied this in my College but never understood it, But now its crystal Clear Kudos to you...!!!🤗
@BackToBackSWE4 жыл бұрын
great
@gloriawang7493 Жыл бұрын
thank you for such a high-quality video. your explanation of "each node needs to execute the same policy" makes a ton of sense! never have i understood traversal so clearly until your video!
@MM-lo9tk4 жыл бұрын
I always assumed this was a super complicated topic and have been putting it off as long as possible. You just made it so simple and easy to understand. Thank you. I think I just found my new favorite channel!
@sasbazooka Жыл бұрын
I'm a Sr. Software Development Engineer who got here without ever taking any CS courses, and now I am hurting for that. This dude here is giving me the exact info I need to fill in the blanks. Bravo dude!
@BackToBackSWE Жыл бұрын
Thank you, appreciate it 😄 Also check out our Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉
@manojchoudhary61463 жыл бұрын
I don't know who's those people who dislike such informative video. Great efforts, keep doing.
@josephwong28324 жыл бұрын
The way this guy walks through these examples is crystal clear.
@BackToBackSWE4 жыл бұрын
ye - this guy
@mhaland2775 Жыл бұрын
I have looked at so many videos to understand this. This is the first video that made me understand it:) The recursive way of thinking was really helpful to understand this
@BackToBackSWE Жыл бұрын
thank you! Means a lot
@haylydo83764 жыл бұрын
I never comment on videos I see, but this one has to be the exception, because this is by far the best video I have seen on this topic. It cleared up so much confusion, and gave me tools to use along the way. Thank you!
@BackToBackSWE4 жыл бұрын
Nice to hear. Thanks and sure
@WorldOfPersianDoc3 жыл бұрын
to the point and straight! thank you! in preparing for my qualifying PhD exam and i just arrive after work and come to starbucks to study! i dont have enough time to read allthings in book carefully so thats the reason this video save much more time for me! tnx again! :)
@marilu00073 жыл бұрын
The only person with charisma to teach Data Structures, I love it! (mosh is also good but you are pure gold)
@iaminhridoy58712 жыл бұрын
To be honest, you way of teaching is as clear as crystal, loved it ...
@sunnypatel17843 жыл бұрын
Your reaction to the cutting and the stomping sounds cracked me up! Great content man! You just got yourself a subscriber.
@birbx3r3544 жыл бұрын
I struggled with data structures and algorithms for 4 years. Watching your vids has helped me finally understand what's actually going on in layman's terms. Thank you so much for making these videos and keep it up!
@BackToBackSWE4 жыл бұрын
ye, great
@jorgeriveramx4 жыл бұрын
Thanks you man, great explanation. I have been a programmer for 11+ years, but never attended software engineering classes, just self taught, this videos help me a lot.
@BackToBackSWE4 жыл бұрын
great and great
@fanifyeyev4 жыл бұрын
I have watched dozens of similar videos, I can tell you, this guy is amazing. The way he provides the material is unbelievable, so motivated, so much energy, so much positive things can be felt.
@BackToBackSWE4 жыл бұрын
thanks - this guy
@johnisdoe4 жыл бұрын
This video is VERY helpful in understanding recursion. I honestly brute forced recursion and never thought of it that way. As someone mentioned in the comments, this channel is a one-in-a-million!
@BackToBackSWE4 жыл бұрын
great
@maxstanley18183 жыл бұрын
two years later, hands down best traversal video on youtube.com. I don't know why schools do not use the nlr rule
@aleksascepanovic47732 жыл бұрын
I dont like ever comment on youtube, just wanted to say thank you.I didnt attend my classes for 2 months due to health issues and was having trouble understanding this going only by code and presentations I had.Thank you, again.
@konekoshoujo3 жыл бұрын
Bachelors in CS, 3 YOE and this is the firs time I understood recursive tree traversal! thank you!!
@alexbowen33815 жыл бұрын
Thank you so much for this video!! I'm an MIS major and a former CS major and after a so many CS courses a 20 minute video by you finally made me understand traversals! You are great at explaining these concepts and I look forward to binging more of your lessons as I brush up for some SWE interviews
@BackToBackSWE5 жыл бұрын
nice thx
@faridashaikh10153 жыл бұрын
lnr at every node just made things so clear for me .....This is just amazing!!!
@crewelghoul4 жыл бұрын
I've been struggling with data structures and algorithms, and this really made things a lot clearer, thank you so much!
@BackToBackSWE4 жыл бұрын
great and sure
@gansaikhanshur49342 жыл бұрын
Who's watching this in 2022. This guys know how to teach!!! Thank you!
@brucewayne31413 жыл бұрын
I study CS at an Ivy League school and I didn't learn shit from my professor's lectures. Your videos are literally saving my grade cuz my final is tomorrow. Thank you.
@juliannafotheringham71012 жыл бұрын
This is the most fantastic, clear video I have ever seen on DFS traversals, thank you so much my dear angel!
@caleboke27713 жыл бұрын
Using LNR as the call stack just help me understood how binary trees work in general. Thumbs up man
@nitingupta15913 жыл бұрын
The best traversal video till now. You teach using first principles. Hats off !
@reinasama904 Жыл бұрын
The quality of this material is beyond what we deserve THANK YOU SIR
@patrid04 жыл бұрын
I have never commented on a KZbin channel before, but you sir, are an amazing teacher. 🤗 Thank you so much, lots of praise for you from the Namibia University of Science & Technology!
@abhilashp443911 ай бұрын
His reaction to the loud cutting noise was hilarious!!
@BackToBackSWE11 ай бұрын
Happy Holidays 🎉 Haha Thank you for your comment, Abhilash! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@safsofapeintor224911 ай бұрын
I rarely comments in videos but your videos really deserves more then comments and likes , I hope u continue sir with such amazing content
@MalamIbnMalam4 жыл бұрын
Nice job, you are making Africans very proud of your content. I'm sure your Ethiopian/Eritrean brothers and sisters agree.
@BackToBackSWE4 жыл бұрын
Great haha though I think everyone should just do whatever. I don't want to inspire one group (though great if it happens). I'm just human, I just see humans.
@bufdud42 жыл бұрын
Wow, I was struggling to visualize recursion for months. This cleared it up for me! Thank you!
@BackToBackSWE2 жыл бұрын
Amaze! Try our 5 day free mini course for some fascinating content - backtobackswe.com/
@yannickwessidjam2036 Жыл бұрын
Wow! the best video I have ever seen!. I have been trying to understand this for so long. No one really explained it in a format that made sense to me. This makes so much sense!. Thank you !!!
@beverlykwok9704 Жыл бұрын
this channel is sooooooo underrated... truly the best coding teacher on youtube
@BackToBackSWE Жыл бұрын
Thank you, Beverly 🎉 Please enjoy a special coupon from us - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SUB 🚀
@ftedg5 жыл бұрын
A channel like yours pushing quality CS videos is really really in need... Thank you so much for your efforts. Most of what's on youtube is low-quality Indian content (no hate). Again thank you so much and please dont stop! I would recommend some videos on Algorithm designs like divide and conquer, greedy method etc.
@BackToBackSWE5 жыл бұрын
Haha, well I think my videos are "ok". I just want to do them and if it helps someone then all the better. If it completely goes over someone's head then that is fine too. Also, I think a table of contents in any instructional video longer than 4 minutes is key. Everyone comes to a teaching with different levels of preparedness and precontext. And in regards to the Algorithms stuff...we will do plenty of that just give it time since I have a long content list to cover. Those topics are in the list.
@soumyajeet78095 жыл бұрын
Lma4a Well i agree, that there's a lot of Indian content but u can't classify everything generally as low quality. I mean, since there are so many Indian channels, there's a good chance that the videos posted are not that good but there're some legit channels that if u learn from u definitely won't be disappointed. Instead u'll thank me later. See the videos on the channel "mycodeschool" and u'll know.
@huilingyan39814 жыл бұрын
I do have seen good quality Indian content videos. The thing is that as a non-native English speaker, i always have to spend extra time understanding what they said lol
@emilyhao92724 жыл бұрын
@@soumyajeet7809 Disagree. All of the content I encountered have been a waste of time. What's even more frustrating is some often switch between English and other languages, highly confusing for the viewer. Just make two videos or stick with one language and subtitle it.
@soumyajeet78094 жыл бұрын
@@emilyhao9272 Here are some Indian KZbin channels that offer their videos only in English and the quality of content is excellent. You should have a look at these. If you still find these a waste of your time, try learning from books or other channels. 1. Edureka 2. Intellipaat 3. Simplilearn 4. ProgrammingKnowledge 5. Mycodeschool 6. codebasics 7. TutorialsPoint India ltd
@bartlomiejdrozd23574 жыл бұрын
Great stuff my friend! Way you use NLR, LRN, NRL is simply beautiful. Few minutes and I got to understand how binary trees are traversed! Thank you!
@BackToBackSWE4 жыл бұрын
ye - great - sure
@jonathanluo0 Жыл бұрын
5:24 explain very well on nlr (Preorder) traversal on each node, plus recursion in general
@sumeyyesalman47193 жыл бұрын
Bro, you are the be(a)st, very intuitive explanations. I am not a cs major, but I can follow you very well. Please keep up the good work.
@pranavmedhi32374 жыл бұрын
All videos on this channel make my concepts Crystal clear
@BackToBackSWE4 жыл бұрын
nice
@tobyhuynh1462 жыл бұрын
dude, your explaination helps me retain the information so much better than other tutorials. writing the policy on each node is a really good trick for a visual learner like me. Thanks
@BackToBackSWE2 жыл бұрын
glad it helped
@srinadhp4 жыл бұрын
The way you explained the recursion is class apart!!! Also how to identify pre/in/post order. Hats off. Will now search for your video on graphs! Hope you have it. Keep posting!
@BackToBackSWE4 жыл бұрын
thanks and ok
@mattdoestechstuff3 жыл бұрын
This was really helpful. My university lecturer did a terrible job explaining this, but you managed to do it so succinctly and clear. Thank you!
@baranturkan95892 жыл бұрын
Dude I wanna say that you are really impressive. This subject really made me confused but with your teaching style that shit became more understandable. Thx so much.
@kakashisenpai994 жыл бұрын
This guy is the best Teacher 😍
@BackToBackSWE4 жыл бұрын
im ok
@kakashisenpai994 жыл бұрын
@@BackToBackSWE 👍👌
@erc_io3 жыл бұрын
Great video! Though for me, a better way of remembering which of pre, in, and post maps to which traversal is just understanding what the words mean. In a binary tree, typically all values in the left branch of a node are less than the node itself. The opposite is true for the right branch. Inorder- If you want to traverse the tree "in order", meaning from lowest to highest value, you'd read the left branch values *before* you read the current node's value. Preorder- You read the the current node's value before the left branch values, so you read it *pre* emptively in a sense, with respect to the order of the values low to high. Postorder- You read the current node's value after both the left and right branches, hence, *post*
@persnlassname71375 жыл бұрын
Thanks to your channel... It really changed on how I see the traversal works, I understand it better and I hope I can pass my midterm exam on this topic. Thanks dude
@BackToBackSWE5 жыл бұрын
nice!
@jacobmoore87344 жыл бұрын
Studying for an interview next week, wasn't a CS major. OP, you're an awesome resource!
@BackToBackSWE4 жыл бұрын
u gon make it
@diveruzumaki55563 жыл бұрын
after three years I finally understand tree traversal properly T_T , THANK YOU
@ichinnorovtuguldur36274 жыл бұрын
I like how he teaches it so passionately. It was super helpful! awesome!!!
@BackToBackSWE4 жыл бұрын
thx - and great
@FracturedOctopus Жыл бұрын
Quality breakdown. Simplified, easy to understand. Much gratitude! Man, even very easy means of memorization. Fantastic.
@speedsanti4 жыл бұрын
It’s hard to keep up and stay motivated with online classes, so I started slacking off in my data structures class. Thanks to you, I feel like I’ve caught up and I feel ready for my midterm on wednesday 😼
@BackToBackSWE4 жыл бұрын
great
@dheerajsharma54925 жыл бұрын
writing order on each node is very intuitive
@BackToBackSWE5 жыл бұрын
yeah
@jonathanberkeley41094 жыл бұрын
you are a good teacher, thanks for the video
@BackToBackSWE4 жыл бұрын
thanks sure
@drodskate5 жыл бұрын
This is exactly what I needed! Thank you so much! You have no idea how hard the summer quarter has been with the lack of explanation.
@BackToBackSWE5 жыл бұрын
nice - happy 4 u
@neall6204 жыл бұрын
when I learned heaps in Data Structures and Algorithms, they were taught as a "nearly complete" tree, and what this video calls perfect, our instructor called complete maybe it was near-perfect complete, looking back
@BackToBackSWE4 жыл бұрын
ok
@carinacarollomalinao74514 жыл бұрын
Sir, thank you very much for this video! Wherever you are, I hope you are safe and feeling well. You made me analyze this in the simplest way possible! I am very grateful to you sir. Thank you so much!
@BackToBackSWE4 жыл бұрын
thx
@drunkmadala4 жыл бұрын
After watching this video, I laughed at myself on how struggled for nearly 8 hours with this concept you just made easy within minutes.
@BackToBackSWE4 жыл бұрын
ur good
@MikeChaseJr4 жыл бұрын
This is amazing. One of the better CS videos. I love how you ask questions to test our understanding as we watch!
@BackToBackSWE4 жыл бұрын
ye
@iulia67074 жыл бұрын
this helped me a bunch for my collage exam, thank you!
@t1910j3 жыл бұрын
Absolutely well explained. I am watching this before my google interview tomorrow. Thanks a lot! Subscribed!
@thomasl8634 жыл бұрын
Turn this one up! You're a great speaker and break down concepts so well.
@BackToBackSWE4 жыл бұрын
thx
@zhangmorgan75735 жыл бұрын
I have to say that all the RAs or TAs are better than any professor in lectures.
@BackToBackSWE5 жыл бұрын
Yeah, it is easier for a student to teach than a professor who does research and is busy. Teaching is hard and a skill unto itself
@son6ahar4 жыл бұрын
God bless you brother. Your style in explaining things is sensational
@BackToBackSWE4 жыл бұрын
thanks and thanks
@alienedbla13333 жыл бұрын
bro you really giving out this quality content for free??? thank you
@Danny19054 жыл бұрын
Awesome. I came from a great CS book I'm reading and the chapter I'm right now touched this topic, so I came here for more info and wow. You helped me to understand it so much better! Keep it up! This channel is awesome
@BackToBackSWE4 жыл бұрын
thanks
@brandonoakes80254 жыл бұрын
Would have saved a lot of money if I found this page a long time ago. Best lectures hands down. 🤙
@BackToBackSWE4 жыл бұрын
great haha
@MatthewSeligman2 жыл бұрын
This explains tree traversal and recusion so clearly! Truly appreciate you sharing this information!
@BackToBackSWE2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@dennisdouglas59415 жыл бұрын
Honestly, You did a wonderful job explaining this content! It was fun, easy to follow and understand! 5 Stars! I did watch all of it, and I shall continue too watch all your videos! You rocked it!
@BackToBackSWE5 жыл бұрын
nice thx
@tmzpanda4 жыл бұрын
0:46 full/complete/perfect binary trees 3:48 preorder/inorder/postorder traversal 5:38 preorder and dfs 11:16 inorder and binary search tree 15:07 postorder
@BackToBackSWE4 жыл бұрын
yes
@naveenantony39242 жыл бұрын
had a basic understanding before, your explanation sealed it for me, also patched up a concept i missed..Keep going 👍👍
@AndrewDaniele873 жыл бұрын
first time I ever subscribed to a channel after watching just 1 video, you have a great teaching style!
@connerjensen81704 жыл бұрын
Awesome! Thanks for this video. I was just attempting a leet code problem where I had to traverse a binary tree and I was pretty lost. You're a great teacher!
@BackToBackSWE4 жыл бұрын
sure and thanks
@GGphantom10315 жыл бұрын
The best American English video to explain the binary tree lesson I am learning in college so far ! T.T ...
@BackToBackSWE5 жыл бұрын
Hey
@frozen_tortus3 жыл бұрын
Absolute hat's down. The teaching style is unique and I love it.
@sorosw29804 жыл бұрын
This video is gold. Thank you!
@BackToBackSWE4 жыл бұрын
sure
@arian1380gh2 жыл бұрын
Great Video. You literally explain better than my PHD prof LOL. Profs always try to use big words to show that they have PHD and that makes everything complicated. You just earned a subscribe bro.
@鄭貫廷-x7h5 жыл бұрын
Hello, I'm student from Taiwan, you vedios are really useful.Thanks a lot.
@BackToBackSWE5 жыл бұрын
AY! Wassup.
@ManojKumar-qe5dd5 жыл бұрын
This channel is One of its Kind ! Great Job.
@BackToBackSWE5 жыл бұрын
It is indeed...it is indeed.
@BloomSayiorriАй бұрын
The best explanation on BST, great work!
@raphk10404 жыл бұрын
you're amazing. I just started learning data structures in C and this is one of the best explanations i've found of binary trees..
@BackToBackSWE4 жыл бұрын
Nice
@mngmay5 жыл бұрын
Super helpful and helped me knock out my assignment in class in no time and will help me remember these concepts long term. Thanks for making these resources :)
@BackToBackSWE5 жыл бұрын
sure
@cesaredecal22305 жыл бұрын
Hey Ben, someone posted your channel on /r/cscareerquestions and from that moment I'm hooked to your videos! Thanks so much for making these videos. I'll have my Twitter internship onsite in two days and your videos are helping me to brush up.
@BackToBackSWE5 жыл бұрын
hahahahah, so THAT's why the channel growth spiked one day. I was so confused. What was the thread? And thanks, yeah, this channel has a long long long long long way to go.
@cesaredecal22305 жыл бұрын
@@BackToBackSWE Haha the guy who posted it actually removed the post contents with the link when I last checked. I don't have the link though. It definitely had more than 50+ upvotes
@BackToBackSWE5 жыл бұрын
@@cesaredecal2230 wow...yeah I've been bugging the moderators for a post. They are definitely sleeping on me. That's why I think I have a ways to go. I need to wake them up.
@weaponkid11213 жыл бұрын
Best explanation. if I ever am searching for a programming concept and you don't have a video I'm sad
@doomera59114 жыл бұрын
dude you have changed I remember watching your Treehouse vids when I was in HS. Now you are teaching stuff that I'm using in college
@BackToBackSWE4 жыл бұрын
hahaha no way! yo thats crazy, im like an internet identity to u but im just a dude
@shaheennamboori2 ай бұрын
Inorder - In - left node right, will remain with me until my last breath, sensei !
@danielbee36972 жыл бұрын
best explaining I've seen so far. Thank you so much!!!