Binary tree traversal: Preorder, Inorder, Postorder

Поділитися
Вставка
  • Опубліковано 6 кві 2014
  • See complete series on data structures here:
    • Data structures
    In this lesson, we have described Preorder, Inorder and Postorder algorithms for binary tree traversal and analyzed their time and space complexities.
    See source code here:
    gist.github.com/mycodeschool/...
    For more on time complexity analysis:
    www.geeksforgeeks.org/618/
    For practice problems and more, visit: www.mycodeschool.com
    Like us on Facebook: / mycodeschool
    Follow us on twitter: / mycodeschool

КОМЕНТАРІ • 387

  • @FabianLopez_lomba
    @FabianLopez_lomba 9 років тому +427

    I've lost track of how many times this chanel has saved me. Great job!

  • @Tommy-yq6vr
    @Tommy-yq6vr 7 років тому +535

    100 times more clearer than those overly complicated computer science books that look like a robot had written them.

  • @CSERISHINANDHA
    @CSERISHINANDHA 2 роки тому +41

    If you noticed, in every single video where he assumes some random addresses for nodes, the minimum difference between the address of any two nodes will not be lesser than 2x(number of bytes occupied by the node in a 64 byte operating system). Meaning, he always stays alert in what he's doing. Respect+💂

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

    After studying it almost everywhere else around a million times, this video finally helped me understand the pre, post and inorder traversal of trees. Thank you so much for making it so easy to understand. I think every computer science student needs to watch this video.

  • @fsandovc
    @fsandovc 3 роки тому +7

    I have to say this is one of the most clearer explanation I have found on UA-cam, everyone explains the ROOT/LEFT/RIGHT and the code part. But the majority don't explain how the memory is managing the nodes data and how it returns it back. Thanks a lot!

  • @pareshb6810
    @pareshb6810 5 років тому +92

    MycodeSchool: "We are reducing this problem in a self similar manner"
    Me: "Oh shit! Recursion is coming😭"

    • @being1better801
      @being1better801 3 роки тому +18

      If you don't understand recursion.
      Read above sentence again.

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

      @@being1better801 😂✌️

    • @mayankkumar7625
      @mayankkumar7625 3 роки тому +2

      @@being1better801 😂😂😂😂

    • @being1better801
      @being1better801 3 роки тому +2

      If you have accepted that recursion is hard for you believe me none of human of this planet will be able to help you understand it.
      Accept that you are pro in programming.
      My mantra
      (Words of Josh Kaufman/The First 20 hours, not mine😅)

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

      Recursion is easy actually but visualising that recursion is really tough

  • @thecoolnewsguy
    @thecoolnewsguy 10 місяців тому +4

    This channel is pure gold 🥇. Everything is just clear without someone showing off instead of teaching. 😀

  • @kevin-kuei
    @kevin-kuei Рік тому +4

    Just wanted to say I really appreciate these algorithm videos. Great explanations, diagraming, and delivery all around. Looking forward to exploring more of your content.

  • @hangchen6131
    @hangchen6131 6 років тому +3

    Awesome walkthrough of the recursive function of the traversal of a binary tree in detail with a stack structure illustrated! I now fully understand the magic behind the code! Your videos are the best data structure tutorials I can find so far! Thanks :)

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

    This was very helpful. I was getting a bit confused on how exactly the recursive code was behaving in relation to the tree and your side by side approach really cleared it up for me. Great job, thank you!

  • @jacquelinelee9836
    @jacquelinelee9836 6 років тому +5

    One of the most talented tutors I've ever seen on UA-cam!!!! You Rock!

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

    Explained really well! Still helping someone 5 years after the video was made now that's quality this is timeless.

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

    Nothing can be better than these playlists.

  • @natureauthor
    @natureauthor 9 років тому +4

    Thank you so much! This video was very comprehensive and incredibly helpful. I love that you put so much thought and detail into explaining this concept.

  • @md-ayaz
    @md-ayaz 8 років тому +11

    I owe you a lot brother. You should continue making videos.

  • @mudassirshahzadkk
    @mudassirshahzadkk 3 роки тому +2

    6 years old but still much better than other latest videos on this topic.

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

    You save my life from Christmas homework.
    You are the hero.
    You are hope of humankind!!!

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

    Sir, you have taught the concepts excellently- no one ever explained these things, the way you did.....!!!!! Thank you for all the pain that you took to come up with such informative videos.....!!!!!

  • @user-mw3zs7uq5u
    @user-mw3zs7uq5u 8 років тому +1

    This is the most elegant explanation of preorder, inorder and postorder. Thank you so much!

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

    Probably the best explanation I've come across for traversing a binary tree. This was really great.

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

    ½ way through a data structure and algorithms course- this channel is a LIFE SAVER

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

    I will never forget any of the tree concepts now. Thank you.

  • @veritas7010
    @veritas7010 8 років тому +32

    The most clear explanations of all youtube, thank you!

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

    I think I've finally wrapped my head around recursion thanks to this video. Great explanation!

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

    Greatest explanation of tree traversals I've ever seen! Thank you so much for making it so easy to understand!

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

    Beautiful explanation.I was stuck for many days in BST.Thanks for saving me out .Great Job guys.Kudos!!

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

    this man is brilliant! just look at how well he explains these tricky topics in such an intuitive manner

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

    Wow...u explained the recursion process really well..way better than other videos on the same topic!!

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

    Great work! The explanation was thorough. I actually found it difficult understanding it from the book data structures using C, but then referred to this video which saved my time.

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

    Your work is more clear and usefull to me while i try to get my degree than most of my classes and teachers, thx :)

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

    Whenever I forget traversals, this channel always helps :)

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

    This is a gem of a channel.

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

    I have always struggled with recursion but this was such a beautiful explanation! Thank you for making these videos!!

  • @lukevassor7743
    @lukevassor7743 5 років тому +2

    I think you just saved my M.Sc. exam. You sir are a legend, recursive thank yous with no cap.

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

    You're awesome. I was having so much confusion about recursive function, but your video cleared the entire concept. Thank you very much

  • @rd-cu1vo
    @rd-cu1vo 8 років тому +3

    i was a lot confused about the recursion but it made everything clear. thanks a lot!!

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

    by far the best explanation for tree traversal on youtube

  • @viviandataact7281
    @viviandataact7281 7 років тому +4

    This is my favorite subject in university, because of you!

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

    thank you for not having any ads and great explanation .

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

    your visual explanation of recursion function is very influensing and good

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

    Hands down the best channel to learn data structures!!

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

    I'm studying a Computer Science course in Uni, you clarified within the space of this video and many others what my lecture could not in 3 weeks in relation to data structures. Yay, I think I won't fail my unit now!!! #Hype

  • @varunVyas
    @varunVyas 10 років тому

    Thanks a million. videos are precise, consistent teaching method, correctly paced, appropriately supplemented with code/pseudocode, concise. Please do some videos on DP and other algorithms that are asked in competitive contests.string matching, graphs etc. Thanks again man.

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

    Fantastic video the visualisations helped so much, looked through many websites and books before I found your vid which clarified everything including time complexity in 15 minutes.

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

    really fruitful.i usually learn through these videos before i teach my students.brief and clear.thank u sir.

  • @rbsupercool
    @rbsupercool 10 років тому +6

    i was waiting for it..finally got it.. every day when i open youtube, first thing i do is check if you have uploaded new videos... thanks a lot.. :)

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

    I have no idea how much I owe you, thank you for all your videos

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

    Finally able to understand the tree traversal in proper and easier way after looking at so many you tube videos!

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

    Amazing video! You explain with such clarity and simplicity. Thank you.

  • @armadonluvr
    @armadonluvr 6 років тому +3

    Studying for my midterm, and this is one of the topics tomorrow. Can not thank you enough for a clear, concise, well drawn, and well thought out explanation. Thanks dude

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

    This playlist is still the best, even 6 7 years after it was uploaded

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

    A crisp and concise explanation! Stuff that clears every doubt just in the first view!

  • @MichalisAntoniou
    @MichalisAntoniou 10 років тому

    Absolutely amazing video! Very well explained, and your diagrams are precise. Thanks!

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

    Hey many thx!!! Actually I found this video the most brilliant one explaining the recursion on the BST. You've saved my day!!! Quite inspired!!! Thanks again for sharing!!!!!!!!

  • @DavidNorman1
    @DavidNorman1 9 років тому +1

    A very helpful and detailed explanation. Thanks for sharing!

  • @mafiotu12345
    @mafiotu12345 9 років тому

    Thank you a lot man, I really missed those lessons in college and you made me understand them. Bless you :D

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

    Thank you so much! the book I was referring to literally over complicated this topic but I can fully understand this topic now thanks again!

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

    Yours videos are building up careers of so many people's across the world and I m one of them thanx a lot sir..

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

    this man is really great I don't know why his videos are not number1 trending on youtube

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

    man, amazing visualization, i couldnt understand but this video was what i needed

  • @shaileshpachbhai432
    @shaileshpachbhai432 8 років тому +3

    This is very good explanation in simple in lucid language. Great Job :)

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

    Thanks for the video, you broke it down very simply in a way I could understand!

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

    I m front end developer... to learn tree I have seen many videos but this one I loved and felt more easy to understand....

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

    Recursive is such a complex thing to understand...but you helped a lot. Thanks so much.

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

    thanks for sharing knowledge like this, it's so fluent. you're the best. My Code School for real.

  • @rohitdoestech
    @rohitdoestech 5 років тому +7

    Still a useful and brilliant video in 2019

  • @ReneeSLiu-zx5tj
    @ReneeSLiu-zx5tj 5 років тому

    This might be the one video that brings me out of the abyss of recursion :) THANKS!

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

    Best Explanation than all other,.....clean and simple.........thank you..

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

    Great video. I thank this channel for nicely explaining the video as it bridged the gaps in my professors explanation

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

    This is so gloriously helpful. Thank you!

  • @paz1359
    @paz1359 9 років тому +3

    after 5 years, I found a tutorial who put me out my misery . thank you so much

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

    You explained so nicely that even a 5th standard student can easily understand this...Thank you so much!

  • @AmgNoWai
    @AmgNoWai 9 років тому +1

    Thank you very much for these wonderful videos they are extremely helpful! Your explanations make these concepts so easy to understand. :D

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

    Thank you so much for the details explanation using visualization, especially the recursion call stack

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

    This is an excellent visualization of these principals.

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

    Awesome video with full in depth explanation with practical examples

  • @at.8887
    @at.8887 8 років тому

    You are amazing, you speak so clearly and explain it very simply while my teacher is able to put us to sleep the minute we start listening.
    GREAT JOB
    p.s: could you please upload videos about ADT and also combining it with structures, trees and such? having also an example including the whole three: Header.h, Implementatiom.c and Main.c and how to build and work with them

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

    This video is actually the best video for understanding recursion.

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

    Very good lesson! It's really clear the way that you explains and your english it's good too that helps a lot!! Thank you!

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

    Thanx a lot for all of ur videos !! u really made all this so simple to understand with u r explanation!!!

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

    Holy shit dude this is a miraculous youtube channel that saves me in my DSA subject. Thanks a ton!

  • @sumitkr.3758
    @sumitkr.3758 4 роки тому

    Best collection of lectures for data structure... Thanks a lot👌

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

    Crystal clear explanation... Great job

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

    Complicated concepts taught simple. OMGGGGGGG I LOVE U!!! SO MUCH THANKS. Couldn't visualize how the recursion works, but after this my mind is clear. Truly wonderful teacher. im subscribing!!!! Hope you continue to teach us more stuff! =D

  • @SenthilArumugamsp
    @SenthilArumugamsp 9 років тому

    Appreciate the effort spend, its really useful for my career.

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

    was a very helpful tutorial , i would highly recommend you to see this about inorder pre and postorder implementation

  • @JD-po3uk
    @JD-po3uk 6 років тому

    the most thorough video i have seen

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

    This guy is an exceptionally good teacher.

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

    really this video has cleared my all concepts...thanks a lot sir

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

    You are missed by all of us ... pls come soon ... u are the legend ...

  • @AnilGupta-iv1rz
    @AnilGupta-iv1rz 5 років тому +1

    I would love to see your videos on advanced data structure topic like adjoint set,trie and AVL tree.

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

    I just finally understood inorder and postorder, thank you so much!

  • @giannisdimaridis2920
    @giannisdimaridis2920 9 років тому

    Great explanation. Exactly what I needed. I'm grateful!

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

    Well explained! I understood the concepts clearly and in detail ! Thanks :)

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

    Thanks a lott for making the concept so clear. Great Job😊

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

    Great video. Complete and easy to understand.

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

    Thank you so much for making these videos. You just made Recursion easy for me. Thank you again(Some Redundancy)

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

    Wow superb explanation broo really awesome I searched soo many videos for those steps but I didn't understand after watching your video only I cleared understand really awesome explaination broo

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

    Your videos on DS are so helpful.. Thank u so much :)

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

    Thanks a lot. I am from Germany but I prefer your videos to any other in my language. You are really talented in expaining