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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 47

  • @JS-dz4bz
    @JS-dz4bz 3 ปีที่แล้ว +5

    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

  • @bajal123
    @bajal123 3 ปีที่แล้ว +26

    Hey Alvin, really enjoyed your dynamic programming course. I love the way you explain stuff. Thank you for what you do.

    • @CoderbyteDevelopers
      @CoderbyteDevelopers  3 ปีที่แล้ว +7

      No prob. Excited to hear that it was useful. -Alvin

    • @ragsbigfella
      @ragsbigfella 3 ปีที่แล้ว +3

      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.🙏🏽

  • @jasonschannel
    @jasonschannel 3 ปีที่แล้ว +8

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

  • @cannabisanomaly
    @cannabisanomaly 8 หลายเดือนก่อน

    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!

  • @pigeonjim
    @pigeonjim 11 หลายเดือนก่อน

    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

  • @jasonliu9790
    @jasonliu9790 3 ปีที่แล้ว +2

    Alvin is the best!!! he deserves so many more views like his dynamic programming video. He is a GOAT

  • @electra7840
    @electra7840 3 ปีที่แล้ว +2

    Easily the best channel in the space, better than every other YT channel atm

  • @AndrewCLC
    @AndrewCLC ปีที่แล้ว

    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.

  • @havefun5519
    @havefun5519 ปีที่แล้ว

    The Pre, In, Post explanation is really clear enough and easily understand. Thanks dude.

  • @electra7840
    @electra7840 3 ปีที่แล้ว +2

    Please do a video on greedy algos and have the differ from DP

  • @mandihaase2744
    @mandihaase2744 2 ปีที่แล้ว +1

    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!

  • @juliaa7321
    @juliaa7321 3 ปีที่แล้ว +1

    Thanks Alvin! Very clean & clear explanations. Please don't stop making more videos.

  • @neelpatel8821
    @neelpatel8821 3 ปีที่แล้ว +2

    Awesome explanation! Waiting for your next videos

  • @Raghav1205
    @Raghav1205 3 ปีที่แล้ว +2

    Your video on dp was very good please consider covering more advanced dp problems, and also make videos in general too.

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars 8 หลายเดือนก่อน +1

    wow, simple, concise and clear
    thank you alvin :)

  • @ramtejeshm9344
    @ramtejeshm9344 2 ปีที่แล้ว

    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.

  • @thurmansanders3072
    @thurmansanders3072 6 หลายเดือนก่อน

    Thanks for this excellent explanation!

  • @banelenyide9087
    @banelenyide9087 ปีที่แล้ว

    this explanation is waay better
    thank you

  • @88spaces
    @88spaces 2 ปีที่แล้ว

    Your explanation is very helpful. I like the way you used the stack object for the depth first approach. Thank you.

  • @harishjulapalli448
    @harishjulapalli448 3 ปีที่แล้ว +5

    Came here from freecodecamp.org. Awesome explanations!! Subscribed.

  • @dev-skills
    @dev-skills ปีที่แล้ว

    Depth First traversal is very well explained with nice visualization

  • @goelnikhils
    @goelnikhils ปีที่แล้ว

    Amazing Explanation. Amazing

  • @kongzilla2897
    @kongzilla2897 3 ปีที่แล้ว +2

    Thank You Very much for such amazing vedios .....I really liked ur Dynamic Programming course.....
    Looking forward for more vedios..
    Thanks again :)

  • @LazyShady
    @LazyShady ปีที่แล้ว

    You just saved me soo much time. Thank you

  • @aaftabpinjari4747
    @aaftabpinjari4747 3 ปีที่แล้ว +10

    Here after your Dynamic programming video on @freecodecamp.org .It was Awesome ,Thank you very much for the Knowledge. Subscribed!!

  • @nbktechworld
    @nbktechworld 7 หลายเดือนก่อน

    Good explanation!

  • @fahadm443
    @fahadm443 3 ปีที่แล้ว +1

    These slides are awesome. Which platform do you use for creating these beautiful slides? Excellent content btw.

  • @zaid4690
    @zaid4690 3 ปีที่แล้ว +2

    Thank you!

  • @amrhossam6851
    @amrhossam6851 2 ปีที่แล้ว

    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.

  • @benmontgomery1111
    @benmontgomery1111 2 ปีที่แล้ว

    Thanks so much!

  • @blitzpark1250
    @blitzpark1250 2 ปีที่แล้ว +1

    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.

  • @compassblue33
    @compassblue33 3 ปีที่แล้ว

    What software do u use for your diagrams/drawings?

  • @johnsoto7112
    @johnsoto7112 2 ปีที่แล้ว

    A1 content!

  • @AmCanTech
    @AmCanTech ปีที่แล้ว

    DFS is same as pre-order? and please make more videos!!

  • @maramcharanteja6320
    @maramcharanteja6320 2 ปีที่แล้ว

    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.

  • @mohammadhoseinabbasi9993
    @mohammadhoseinabbasi9993 ปีที่แล้ว

    how does the tree recursively goes back to the parent after it reaches null in a node?

  • @burhanuddinmerchant877
    @burhanuddinmerchant877 3 ปีที่แล้ว +4

    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!

    • @CoderbyteDevelopers
      @CoderbyteDevelopers  3 ปีที่แล้ว +1

      Glad to hear you are finding value in the content! -Alvin

  • @cmdv42
    @cmdv42 ปีที่แล้ว

    🙌💯

  • @mohammedfaseeullah6095
    @mohammedfaseeullah6095 หลายเดือนก่อน

    why youTube take too much months to recommend this playlist

  • @dmoney_thegreat
    @dmoney_thegreat ปีที่แล้ว

    How you handle a tree that wasn't binary? Let's say you had 4 children of a node.