Simplest Binary Tree Traversal trick for preorder inorder postorder

Поделиться
HTML-код
  • Опубликовано: 6 фев 2025
  • This video lecture shows the simplest way to traverse a binary tree in preorder inorder and postorder. This trick can be applied even without pen and paper and you can determine the traversal order in just a matter of seconds. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

Комментарии • 915

  • @techdose4u
    @techdose4u  Год назад +7

    🟣 JOIN our 𝐋𝐈𝐕𝐄 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐭𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 through whatsapp query: +91 8918633037
    🔴 𝐂𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐚𝐥𝐥 𝐨𝐮𝐫 𝐂𝐨𝐮𝐫𝐬𝐞𝐬: techdose.co.in/

    • @mehdisanjaghi292
      @mehdisanjaghi292 6 месяцев назад

      Can the chart and algorithm be drawn for a large input data set?

  • @stephank.murphy4874
    @stephank.murphy4874 3 года назад +996

    So in summary, always go from the root in counterclockwise direction around the tree.
    - For Pre-Order, print the nodes as you visit them for the first time.
    - For In-Order, print the nodes only when you visit them for the second time.
    - For Post-order, print the nodes when you visit them for the last time.
    Kudos man, that is succinct and sticks. Great job.

    • @eggieboyespillo2899
      @eggieboyespillo2899 2 года назад +7

      Thank you!

    • @RandomFortress
      @RandomFortress 2 года назад +6

      Thanks for saving my time.

    • @AK24edits
      @AK24edits 2 года назад

      Thx 😊 🙏

    • @justusjonas11
      @justusjonas11 2 года назад +3

      This may be even faster in exams then the traditional way. Nice

    • @Tyrese1701
      @Tyrese1701 Год назад +2

      Best CS tutoring video comment I have ever seen in my life. You are true god

  • @pieosaurus3
    @pieosaurus3 4 года назад +662

    2 different professors have tried to teach me this and I did not understand it. This 7 minute video explained it better and WAY faster than them. Thank you so much!

    • @techdose4u
      @techdose4u  4 года назад +17

      Welcome :)

    • @TheLazyLemmon
      @TheLazyLemmon 3 года назад +3

      @@yutaitadori7318 relax brother

    • @rawmetal3052
      @rawmetal3052 Год назад +3

      ​@@techdose4uthank you for explaining. Albert Einstein once said if you can not explain something in simple terms, that means you have not understood the problem enough. You sir are clearly more knowledgeable than most profs

    • @nikolasioakimidis3003
      @nikolasioakimidis3003 Год назад +1

      While yes, it's the fastest and easiest way, you don't really understand what's happening and why you are doing what you are doing. Don't get me wrong, this is an amazing video but every technique has its pros and cons

  • @AdityaMaheswari-l8h
    @AdityaMaheswari-l8h 10 месяцев назад +32

    These 7 minutes were the most productive 7 minutes i have ever spent on anything.

  • @sheikhaman6218
    @sheikhaman6218 4 года назад +181

    You have converted my 50 min class into 7 min dope session man❤

  • @RamprasadKaranth
    @RamprasadKaranth 3 года назад +407

    You must be kidding ... You have successfully trolled all the professors out there .. This is a godsend !

    • @techdose4u
      @techdose4u  3 года назад +15

      😂

    • @black_godfred
      @black_godfred 3 года назад +20

      True. I said the same 😃 I have an exam in 4 hours time

    • @Amirhussain_99
      @Amirhussain_99 3 года назад +2

      This is just theory dude!! The main part is how will you do this.

    • @Racist112
      @Racist112 Месяц назад

      Saar you are blady funni

  • @nosiphokhumalo656
    @nosiphokhumalo656 3 года назад +39

    I think this is the third time I'm watching the video, have wrote tests without fully understanding this but after today I got it a 100 percent, the post-order was well explained thank you so much

  • @ape8404
    @ape8404 5 лет назад +134

    Super logical explanations. In-order was especially confusing for me but your strategy makes it super easy, thank you!

    • @techdose4u
      @techdose4u  5 лет назад +3

      Welcome :)

    • @s1cilian80
      @s1cilian80 4 года назад

      Tech Dose, he directly fully conveyed my feelings of gratitude. Thanks

    • @keysersoze7919
      @keysersoze7919 3 года назад

      Remember Inorder as DFS

  • @EvanMrFreak
    @EvanMrFreak 2 дня назад

    Seeing this just before the exam and cleared the topic in a jiffy. Truly man, as a slow learner this is the fastest thing I learned.
    Jazakallah Khair.

  • @awad2226
    @awad2226 2 года назад +36

    12 hrs before exam and I couldn't even understand this concept well. Really inspiring and helpful. Thank you so much :)

  • @BillboMC
    @BillboMC 3 года назад +93

    The post order explanation was 🤯 GENIUS “has been reached for the third time” is the easiest logic ever

  • @aliazab5310
    @aliazab5310 2 года назад +9

    3 years ago and still helping tons of people, thanks for this amazing explanation dude, you seriously rock!
    I'm definitely sharing this with my Uni mates.

  • @siddharthsubramanian4687
    @siddharthsubramanian4687 4 года назад +15

    This is strategy is so good. I don 't understand when just the concept is being taught, i only get the concept while explaining an example like this. TY.

  • @renasalp8695
    @renasalp8695 Год назад +3

    There is no complicated things , everything is clear and basic . Literally amazing ❤thanks for it 🙏🏻🙏🏻

  • @lukepacheco906
    @lukepacheco906 2 года назад +4

    showing the null values under the leafs was really helpful and made me actually understand how each traversal algorithm was different, something my prof couldn't do, and in only 7 minutes! wow

  • @Sory_Bâh
    @Sory_Bâh Год назад

    This is great man, I have spent 4 hours in class without understanding anything but just within 7 minutes I got everything very well!

  • @amberlin79
    @amberlin79 Год назад +1

    thank you so much for saving me hours of studying time. This guy is a genius.

  • @MKYEuphoria
    @MKYEuphoria 2 года назад +3

    Thank you for your simple straightforward approach. Took me so many videos to grasp these 3 traversals.

  • @prajaktakadam4779
    @prajaktakadam4779 3 года назад +2

    Excellent teacher I ever saw in my Life....You save life of students who learning DS but didn't understand anything.Your trick will helpful for my placement exam.

  • @boramawi
    @boramawi 9 месяцев назад +4

    This is so simple! Yet most of the professors leave you confused after 3 hours of lecture!

  • @jialincai1192
    @jialincai1192 8 месяцев назад

    Truly the simplest and most intuitive way that I've seen this topic explained. You're a godsend.

  • @ashiquerasul6928
    @ashiquerasul6928 5 лет назад +8

    It's the most easy way to do it....great explanation ...Thanks alot sir 💞💞

  • @hetshah533
    @hetshah533 Год назад +1

    Amazing method, you have converted 2 hrs lec in just 7 minutes!!!! thanks a lot sir :)))

  • @a.rhythm9702
    @a.rhythm9702 4 года назад +12

    I really loved your method of approaching the graphs. It really is simple & easy to learn.... Thanks a lot :)

  • @ruvindamanoshitha2047
    @ruvindamanoshitha2047 Месяц назад

    I think simplest video i have ever seen in tree traversal You are best tutor of my tree traversal lesson

    • @techdose4u
      @techdose4u  Месяц назад

      Thanks for your appreciation

  • @HateNoobsGR
    @HateNoobsGR 2 года назад +3

    Actually amazing. I was trying to figure it out by myself and when I though I got it i realised I did everything wrong xD Thanks for this amazing method, super easy!

  • @idc20627
    @idc20627 6 месяцев назад +1

    Lmao, took dsa in my community college and now again at a 4 year just because its more rigorous at this school and I always come back to this video for traversals of binary trees, thanks for doing the lords work

  • @erdemahsen
    @erdemahsen 4 года назад +3

    That 2nd and 3rd time explanation was rly good. Thx bud

  • @LincyMcGabby
    @LincyMcGabby 8 месяцев назад

    Been trying to understand these concepts for ages & failing to. This video helped me understand them easily. Thank you.

  • @anjukrishnan5934
    @anjukrishnan5934 4 года назад +3

    Watched many videos.this is the simplest one. Thank you so much

  • @ShahidKhan-jg2ev
    @ShahidKhan-jg2ev 18 дней назад

    Genius hats off🎉 was struggling for 3 hrs saw this video and learned in 3 minutes hats off yaar🎉❤

  • @zakenmaru8612
    @zakenmaru8612 4 года назад +7

    This is fantastic, and I love how you explained the logic. Tyvm!

  • @Tyrese1701
    @Tyrese1701 Год назад

    Best CS tutoring video I have ever watched in my life.

  • @phantomifyy
    @phantomifyy 4 года назад +12

    Thank you so much! This was so easy to understand, and with the pattern, it can solve any problem!

  • @Haraqu8984
    @Haraqu8984 Год назад

    You just cleared my concept in just 8 mins and for me it's crucial time because of having a quiz tommorrow of this topic hats off to you 👏

  • @chinonso_e
    @chinonso_e 4 года назад +4

    This was really good and your method makes it easy. well done

  • @claritydive
    @claritydive 2 года назад

    This is defiantly the best explanation I've seen so far.

  • @renzmichaelmanuel5023
    @renzmichaelmanuel5023 3 года назад +4

    Your tutorial was effective! I get it immediately, thank you

  • @riyanj5797
    @riyanj5797 17 дней назад

    My DSA teacher taught like Pre Order was(Root, left, Right) , In order was (Left ,Root, Right) and post order was (Left , Right , Root) , it was soo confusing for me to understand , But this video is Fire , soo simple and easy to understand . Thank You !

  • @lizinessence1682
    @lizinessence1682 4 года назад +3

    Clear explanation, thank you!

  • @Grypolx
    @Grypolx 3 года назад +2

    Literally ! I am speechless! This is good work and the score is 1 to ( You ) - 0 to
    ( My professor)

  • @somebodywithaname8718
    @somebodywithaname8718 3 года назад +5

    Basically, it has to do with which side of the node you hit.
    Pre- print on left side
    In- print on bottom side
    Post- print on right side

  • @veerag803
    @veerag803 2 года назад +1

    Oh god you saved my life....from 5hrs I am trying to figure it out....but u made it easy👍

  • @siddharthsingh4288
    @siddharthsingh4288 4 года назад +7

    This is golddddddd ❤

  • @terminalfx-m5p
    @terminalfx-m5p 2 месяца назад

    this 7 mins video makes the whole traversal concept very simple , even an 8 yr old can understand your explanation
    🔥🔥🔥

  • @angelochavez2085
    @angelochavez2085 4 года назад +2

    the way my professor taught us about this was so hard but yours was so much easier thank u so much

  • @abdullahyousaf9602
    @abdullahyousaf9602 8 месяцев назад

    wow, you explained it so clearly. My professor went over it so fast and made it sound so complicated. You were able to explain it faster than him!

  • @victor_okpala
    @victor_okpala Год назад +1

    You are an excellent teacher. ❤

  • @whatwedointhyshadows
    @whatwedointhyshadows 2 месяца назад +1

    Amazing, I come back to this video every year!

    • @techdose4u
      @techdose4u  2 месяца назад

      Please and comment your year everytime to remember :)

  • @PeterXyzdlv
    @PeterXyzdlv 2 года назад +1

    Thanks for this. The most natural and logical explanation one can get.

  • @vil3n80
    @vil3n80 2 года назад

    Best explanation I've seen. no ones mentioned on 1st, 2nd, 3rd reach. Clicked instantly

  • @sonkagito3756
    @sonkagito3756 2 года назад +1

    90 min lecture explained in just 7 min.. Thank you

  • @Peter.H___
    @Peter.H___ 3 года назад +1

    Thank you so much, because of you I'll end up passing my exam. This made what my lecturer was teaching seem so easy

  • @anjipi3846
    @anjipi3846 11 месяцев назад

    Thank you very much for that video. I didn't understand that topic during the lectures at my university, but now it's easy for me :)

  • @iamwithyou554
    @iamwithyou554 2 года назад

    Amazing and mind-blowing trcik sir tqq so much for giving this lecture .no one said like you.we need a professor like you sir

  • @joya9785
    @joya9785 2 года назад

    This is a great working method like whenever you want to look at how to trace the traversals it's pretty easy to understand. Kudos to you.

  • @mgvcreative4529
    @mgvcreative4529 5 месяцев назад

    Method of u r explaining is mind blowing 🔥

  • @rakshithahd7861
    @rakshithahd7861 2 года назад

    many have teached me this I haven't understood
    but in this 7 min video i have understood properlyy
    thank youu

  • @jaykoladiya8961
    @jaykoladiya8961 3 года назад +2

    Thank you so much sir for this amazing trick I had seen many lectured I didn't understand but when I saw this 7 minute video I know properly I am so glad sir having like u sir🥰❤🙏

  • @sphemavimbela1652
    @sphemavimbela1652 4 года назад +1

    Wow i wish you were my teacher for all my computer science modules you make things easy to understand.

    • @techdose4u
      @techdose4u  4 года назад

      Wish I had the degree :)

  • @joeman677
    @joeman677 Год назад

    I feel many professors try to dance around the simple way these traversals work and try to teach tricks on how to remember them like with post order being bottom to top (with left to right) but actually going over them in this simple demonstration helps much more.

  • @Yogesh-r1r
    @Yogesh-r1r 2 года назад

    I learned very clear about this topic today its really help for my tomorrow's exam thanks man...

  • @aliyuumargumel7869
    @aliyuumargumel7869 Год назад

    My headache has been cured sir. Thank you very much.

  • @rahul19ify
    @rahul19ify 3 года назад

    Mind blowing concept...I have seen many videos on this topic but none come as clear as yours.

  • @ja25921
    @ja25921 3 года назад

    Best explanation I have seen so far. I'm ready for my final!

  • @Escapetheordinary-y3t
    @Escapetheordinary-y3t 3 месяца назад

    BEST explanation ever, straight to the point.

  • @jonnabohol6131
    @jonnabohol6131 3 месяца назад

    wow this video made me understand totally how the output in each type of traversal works! amazing tutorial!

  • @vaishnavirao5413
    @vaishnavirao5413 2 года назад

    I'VE NEVER UNDERSTOOD SOMETHING SO FAST

  • @ezanatadesa2485
    @ezanatadesa2485 6 месяцев назад

    I can't believe this is free, Thank you very much bro

  • @pinklegautam460
    @pinklegautam460 4 года назад +2

    Dude😂 you the hero!!
    I was going to skip this topic!
    And now this is easiest topic so far🙂
    Idk why our clg teachers can't explain us with this simple trick instead of confusing us 😩

    • @techdose4u
      @techdose4u  4 года назад

      😂 Great. Profs like to chill 😆

  • @MomenteRO
    @MomenteRO 3 года назад +1

    Thanks so much! Commenting for the youtube algorithm and to show support!

  • @NishagAppu
    @NishagAppu 7 месяцев назад +1

    thanku for explaining pre in and post order in such a easy way my 5 month class converted into 7mints🫡

  • @girishu
    @girishu 10 месяцев назад

    the best vedio on utube for this topic

  • @abdulwasia4528
    @abdulwasia4528 11 месяцев назад

    Brilliant and outstanding and easiest way to solve this problem ❤❤❤You desrve the fees we pay for our studies in university.

  • @yunqiyin5405
    @yunqiyin5405 9 месяцев назад

    The best video of presenting the traversal, thank soooo much

  • @KomanduriLalithya
    @KomanduriLalithya Месяц назад

    Tomorrow is my semester exam and im preparing omgg thanks you are amazing this really helps i couldn't understand this orders until i saw this video

  • @tamertamer729
    @tamertamer729 2 года назад +1

    You are a legend . Thank you ❤

  • @aneeshani3083
    @aneeshani3083 2 года назад

    Everyone Try This 💯 Working
    Thank you for making easy ❤️

  • @RomanHajy
    @RomanHajy Год назад +1

    you are better than the most famous teachers

  • @annjames6522
    @annjames6522 4 года назад +1

    The best tree traversal explanation.......Thank you

  • @tathabratisarkar7744
    @tathabratisarkar7744 2 года назад

    Great great tip i have exam tomorrow and this made my work easier

  • @maydalynnho2572
    @maydalynnho2572 8 месяцев назад

    Wow thanks to you i can finally ace my computing exams

  • @chicoman264
    @chicoman264 9 месяцев назад

    Thank you for this explanation, I finally understand now thanks to you. You are amazing at teaching.

  • @14paramkoli27
    @14paramkoli27 3 месяца назад

    Watched this before entering my exam hall and it came, secured 5marks because of you. Thank you ❤

  • @HRMusicDrive
    @HRMusicDrive 3 года назад +1

    Thank you so much this video made topic very clear..I worried a lot without understanding the topic... thanks dude now I got it...

  • @robertweekes5783
    @robertweekes5783 6 месяцев назад +1

    You can also think of pre-order traversal as printing when the track goes along the _left_ side of the node. For in order traversal, you print when it wraps around to go _under_ the node. For post order traversal, print the value when it comes along the _right_ side of the node.

  • @vivianpaul2078
    @vivianpaul2078 3 года назад

    this guy roasted every single programming professors in 7min 14sec

  • @WilliamCWayne
    @WilliamCWayne Год назад

    Thank you for this excellent visualization! Including the null child trees really made all the difference!

  • @preranasharon885
    @preranasharon885 8 месяцев назад

    You saved me in my exams 😪
    Thank you for keeping it very simple and short

  • @clouzyown3459
    @clouzyown3459 Год назад +1

    Thank you thank you so so much...This is way easier to understand than what my teacher is giving us..😭😭I have a test tmwr and this helped me so much.. You just got yourself a new subscriber 😭

    • @techdose4u
      @techdose4u  Год назад +1

      Why dont the teachers teach this simple trick 😅

    • @clouzyown3459
      @clouzyown3459 Год назад

      @@techdose4u You are absolutely right..😭

  • @rohangosavi9686
    @rohangosavi9686 2 года назад

    bro this has to be the easiest method to understand! thank you so much :)

  • @Ramkumar-rd8vq
    @Ramkumar-rd8vq Год назад

    Bestest video so far on this topic.🧡

  • @logeesh2009
    @logeesh2009 2 года назад +1

    Great Video. I am starting binary tree from this video

  • @ujjawalpugalia2123
    @ujjawalpugalia2123 2 года назад

    You saved my career by teaching this

  • @pratikrathod5465
    @pratikrathod5465 Год назад

    Although I know all three traversal I'm not gonna use that algorithm now I'll be using this method only because it's more fast and accurate thanks sir!!!!❤

  • @bhuvanabhuvana6557
    @bhuvanabhuvana6557 Год назад

    Literally amazing u will explained in very simple manner and easy to understand thank a lot sir

  • @richerops4419
    @richerops4419 2 года назад +1

    You're the best. Thank you.

  • @ChiefYoshi
    @ChiefYoshi 9 месяцев назад

    my professor explained it well but this is much easier to remember. thanks

  • @kingaces13
    @kingaces13 2 года назад +1

    Thank you for the awesome explanation! I could not understand this, no matter how anyone tried to explain it to me.

  • @raves_r3177
    @raves_r3177 3 года назад

    Thank you so much. I could not really understand what was going on when my professor did it. But this trick is very logical and clever. Again thank you very much good sir.