Pre-order tree traversal in 3 minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ย. 2015
  • Step by step instructions showing how to do pre-order tree traversal on a binary tree.
    Code: github.com/msambol/dsa/blob/m... (different than video, I added this retroactively)
    Source: en.wikipedia.org/wiki/Tree_tr...
    LinkedIn: / michael-sambol

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

  • @cugamer8862
    @cugamer8862 4 ปีที่แล้ว +58

    Finally, someone who explains algorithms and data structures using plain English instead of mathematical notation. Not all of us had the benefit of a four year CS education, you're doing a great service here.

  • @88zachary88
    @88zachary88 6 ปีที่แล้ว +101

    Fun fact: if you apply pre-order traversal of a BST on the British royal family tree (ordered by age) this is how the crown is passed along.

    • @flurple6921
      @flurple6921 4 ปีที่แล้ว +45

      @@I3uzzzzzz I see you've set aside this special time to show the public that you weren't raised right

    • @synq-_-8595
      @synq-_-8595 3 ปีที่แล้ว

      @@VatsalRajyaguru17143 fuck you too

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

      no I am actually working on Top-down parser for the compiler I am designing>.>

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

      I guess im asking randomly but does anyone know a method to get back into an Instagram account??
      I stupidly forgot the password. I appreciate any tricks you can offer me

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

      @Zahir Sonny Instablaster :)

  • @magscovers8924
    @magscovers8924 2 ปีที่แล้ว +14

    Dude you saved my life. You just explained a concept my data structures professor was trying to explain in a 2 hour video. He overloaded us with so much information that the important parts were incomprehensible.

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

      I hate long lectures where you have to go through the entire things to just filter out maybe a few minutes of useful content, but this video, 3 minutues, pure gold

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

    I want this guy for every concept I need to understand. Absolitely spot on, brief and concise

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

    This video and the other one you have on post-order tree traversal are absolute gold. Was so confused by how recursive functions work (especially with the return keyword), but this is definitely helping me piece it together :))

  • @manasabokka783
    @manasabokka783 4 ปีที่แล้ว

    clarity, while you explain, is amazing, the way you strike visit, left, right to indicate the call stack is very helpful to imagine recursion.

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

    Thank you! You're an amazing teacher. You were able to take a complicated concept (at least to me) and able to explain it in plain terms.

  • @RECTmetal
    @RECTmetal 5 ปีที่แล้ว +2

    Thank you for making a nice clean and straight forward explanation!

  • @udanamethmal6632
    @udanamethmal6632 5 ปีที่แล้ว +1

    Dude thanks a whole freaking lot for these 3 videos. Saved me a great amount of time

  • @zboobafett5984
    @zboobafett5984 4 ปีที่แล้ว

    Michael I just wanted to say I love you so so so much. I have seen this videos and many others videos and that helped me a lot in my student life. You're a genius !!!

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

    Thank you so much for your efforts at beautifully explaining this and other algorithms. Subbed.

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

    omg this was so simple yet so effective, thanku so much

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

    Concise and no weird language. Thank you

  • @gorkemkayas
    @gorkemkayas 6 วันที่ผ่านมา

    Thanks for clean explanation

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

    Very nice explanation. Thank you! Subbed!

  • @DanielLochner
    @DanielLochner 5 ปีที่แล้ว

    Absolutely brilliant!

  • @angelvasquez9468
    @angelvasquez9468 4 ปีที่แล้ว

    Great explanation. Thank you.

  • @maryamd6396
    @maryamd6396 8 ปีที่แล้ว

    Hi! Your videos have helped me out a lot for maths. I was wondering if you could do a video on the Route Inspection problem(Chinese postman problem). Thanks x

  • @sreehari563
    @sreehari563 5 ปีที่แล้ว

    extremely helpful,thank you😘👍

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

    Brilliant video!

  • @Ashkan55628
    @Ashkan55628 4 ปีที่แล้ว

    Best Explanation

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

    Good explanation dear friend.... I helped me a lot 👍👍👍🙏🙏🙏thank you 💖😊

  • @giliaki1995
    @giliaki1995 8 ปีที่แล้ว

    is there any chance you will do Dinic's algorithm? Thank you

  • @maremp5
    @maremp5 8 ปีที่แล้ว +6

    I like your explanations, every single video was helpful. Could you make videos about drawing different trees, like AVL, Red-Black and B-Trees?

  • @merajis
    @merajis 7 ปีที่แล้ว

    Awesome! thanks

  • @ameypote8148
    @ameypote8148 5 ปีที่แล้ว

    God bless you !

  • @user-sr1pp7sv9q
    @user-sr1pp7sv9q ปีที่แล้ว

    Thank you so much

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

    Excellent

  • @peterzhou3366
    @peterzhou3366 4 ปีที่แล้ว

    thanks for sharing

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

    Thank you! :D

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

    THANK YOU SO MUCH

  • @EndieM8
    @EndieM8 5 ปีที่แล้ว

    please keep making videos

  • @moustafa_elsaid
    @moustafa_elsaid 5 ปีที่แล้ว

    Thanks for your effort, can you please
    make the same for graphic traversal?

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

    thank u dawg

  • @salmanalimughal6386
    @salmanalimughal6386 6 ปีที่แล้ว

    THNX :)

  • @daveydaveywigwam
    @daveydaveywigwam 5 ปีที่แล้ว

    Nailed it

  • @Resorization
    @Resorization 5 ปีที่แล้ว

    Thanks ;)

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

    thanks!

  • @moustafa_elsaid
    @moustafa_elsaid 6 ปีที่แล้ว

    please give video for graph traverse methods

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

    Just follow this rule it might not be the same with the actual code implementation where stacks get pushed and popped but if you want to do a quick traversal follow this tips : 1-In Preorder traversal the first time you reach each node you perform your operation (visit) 2-In Inorder traversal for the second time you reach each node again , you perform your operation(visit) 3- In post order traversal for the Third time you reach each node perform your operation (in this case visit , you can do whatever you like ;) )

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

      And also always traverse from left to right so from the root node go to left first

  • @nuclear804
    @nuclear804 4 ปีที่แล้ว

    thanks laddy

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

    good

  • @australia7003
    @australia7003 5 ปีที่แล้ว +9

    It's so nice to get explanations which aren't from an incoherent Indian man. Thanks, keep it up!

  • @anonanon6596
    @anonanon6596 4 วันที่ผ่านมา

    TH-cam now ai-translates titles and I hate it.
    To translate the title that shows up to me back to english: "Pre-sale on trees. Order now in 3 minutes".

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

    hello a level exam people

  • @mladenkaorlic6028
    @mladenkaorlic6028 4 ปีที่แล้ว

    You should get salary instead of my teachers...