Pre-order Traversal Algorithm | Tree Traversal | Visualization, Code, Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

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

  • @AnupatraRuchutrakool
    @AnupatraRuchutrakool 10 หลายเดือนก่อน +6

    IIt takes me so long to find someone who can easily explain the stack frame with recursion. This is really easy to understand! Thanks a lot.

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

    Couldnt understand what my lecturers were teaching till I came into this video, which was explained in terms of call-stack, where my other teachers failed to recognise. Thank you for saving my grades!

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

    I just wanted to say thank you so much. I know how much this time this must have taken writing the visualization animations but your work doesn't go unappreciated. You going over how it looks like at each frame in the call stack was really essential. Also, I really appreciate the visualization of the print output and where we are in the bst. Thank you so much ygong!!

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

    Great explanation! Your animations make tree traversals so much clearer. Thanks a lot

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

    By far clearest explaination on binary preorder recursion traversal, thank you!

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

    You dropped this fam 👑

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

    best video for understanding traversal BST, thank yo so much

  • @afrozakhatun-pr9qj
    @afrozakhatun-pr9qj 3 หลายเดือนก่อน

    thank youuuuu❤❤❤❤
    First time i realize this topics of recursion

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

    Great explanation, the best I have seen so far. I am definitely liking and subscribing.

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

    Wow this wouldve been so helpful back in college. This stuff was a nightmare to me back then.
    And now a few years later, I'm needing to rebrush up on these skills to stay marketable for interviews... Thanks

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

    This animation really helped a lot...

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

    omg, it finally clicked to me!!!!!!!!!!! Thank you sooo much

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

    Thank you so much, this really helps!

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

    Great explanation..very useful 🙏😍

  • @عمرصطحي
    @عمرصطحي 2 ปีที่แล้ว +1

    simple explanation thank you so much man

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

    can you explain why this preorder(root.right) is automatically called for the parent node even if the pointer is at the child

  • @AkashRoy-do2dg
    @AkashRoy-do2dg 3 ปีที่แล้ว

    you are a lifesaver!

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

    that was by far the best video , thank you so much for this great explanation. The only thing I don't understand is that after we are done leftmost node(1), we pop the preorder(1) from call stack and go to preorder(2) and what stops program to go again to left child of node(2) here. And instead of going to node1 again it goes back to top. i dont understad what prevent going to node1 again in the preorder2 function in the calla stack.

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

      At 2:36, notice the yellow code arrow. We entered preorder(1) via preorder(2)'s "preorder(root.left)". So when we are done with preorder(1), we have exited out of preorder(2)'s "preorder(root.left)", so we would move onto preorder(2)'s "preorder(root.right)", so we'll never visit node(1) ever again b/c we'll never execute "preorder(root.left)" in preorder(2) past this point.

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

      🔥🔥😍😍🥰🥰💖💖🙏🏽🙏🏽@@ygongcode

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

    awesome explanation sir

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

    I dont understand why we are making a recursive call to the Root. I mean the First Step is to process the Root, thats Not recurisve ,so why the 5 gets in to the Stack?

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

    Such a good video....

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

    This is seriously the best visualization explanation so far , but how does it pop things out of the stack by remembering? Like when the control hits the leaf node 1 , the left node is null , it returns null, I really dont understand how it remembers the previous execuition of the statement preorder(root.left) was null and proceed to the next statement

  • @alperendilaver.
    @alperendilaver. ปีที่แล้ว

    excellent explanation thank you

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

    THANK U BROTHER.

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

    best video animation

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

    why just 490 subscription... so good

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

    good bro

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

    very helpful

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

    Thank you

  • @চর্যাপদ-ট৬ছ
    @চর্যাপদ-ট৬ছ 3 ปีที่แล้ว

    good video, Can you do this for a post-order video.

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

      Yes, it is here th-cam.com/video/4Xo-GtBiQN0/w-d-xo.html