Recursive Postorder traversal of a Binary Tree in Java

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 43

  • @itsdineshvaryani
    @itsdineshvaryani  3 роки тому +3

    Please *Like* , *Comment* , *Share* , *Subscribe* and *Click Bell* 🔔🔔🔔 Icon for More Updates. To get *Data Structures and Algorithms* complete course for free please follow this link - ua-cam.com/play/PL6Zs6LgrJj3tDXv8a_elC6eT_4R5gfX4d.html

  • @ujjwaljagtiani5760
    @ujjwaljagtiani5760 4 роки тому +8

    Never have I seen someone explaining trees recursion so well. Wonderful !

  • @sameergrover7
    @sameergrover7 6 місяців тому +1

    There are n number of channels on youtube but the way you teach things is completely different it's simple, precise and just point to point no rubbish ! You are great sir! Thank you for the wonderful videos never stop teaching us !

  • @travelnlearn
    @travelnlearn 2 роки тому +4

    You have made pre post and inorder easier for us to understand. Thank You , these videos are a gem for me.

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

      Thanks ... Please share it with your friends and colleagues too !!!

  • @shubhamagarwal1434
    @shubhamagarwal1434 2 роки тому +2

    Best series for DS & Algo. I am also 10 yrs java exp guy. Was looking for DS & Algo free course over UA-cam with java implementation and found this. Hats Off To You Man..Excellent Work. GOD BLESS YOU :)

  • @vigasvigas8848
    @vigasvigas8848 2 роки тому +1

    I'm searching for long days, this kind of explanation for recursion..thanks for making the concept of recursion easier

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

    Finally I found this video which has a detailed explanation about Postorder Traversal in java. Top quality explanation! Thanks a lot!

  • @bharathenishetty1550
    @bharathenishetty1550 2 роки тому +1

    superb video what a patience, clean and clear cut explanation

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

    Iterative approach pseudo:
    Stack s1 = new Satck();
    Stack s2 = new Satck();
    s1.push(root);
    while(!s1.isEmpty()){
    temp = s1.pop();
    s2.push(temp)
    if(temp.left != null) {
    s2.push(temp.left);
    }
    if(temp.right!= null) {
    s2.push(temp.right);
    }
    }
    Now pop all the elements of s2 stack they will be in post order

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

    Best channel for learning DSA.

  • @ascar66
    @ascar66 2 роки тому +1

    Thank you sir, nice video! Comment to support your channel

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

    very good explanation. Can you please post other videos in this series? For dynamic programming, greedy algorithms and graph theory, String algorithms..

  • @aadityajaiswal1970
    @aadityajaiswal1970 2 роки тому +1

    Sir,which one should we follow, recursive or iterative approach.

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

      both hv similar complexities ... recursive is easy to write !!!

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

    best explanation sir ji

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

    Thanks buddy!! your video was awesome and very helpful!!

  • @shubhamsingh-lf6zy
    @shubhamsingh-lf6zy 3 роки тому +2

    Sir when value is null why execution goes to 6 why not to 1?

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

      Can you ping me a video timeframe where u cannot understand?

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

    Hi SIr ..I want a video on quick sort and some video on stack prefix and suffix

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

    Is it okay to have a method as "public void postorder(){// if() return}" and have a return statement within it?

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

    Thanks for explaining the code!

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

    thank you

  • @jaspalsingh-mv5xh
    @jaspalsingh-mv5xh 2 роки тому +1

    Great

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

    At 17:08, line no. was changed from 5 to 6. Can u explain a bit further, why changed.

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

      *postOrder(root.left);* of 9 was completely executed, therefore *postOrder(root.left);* (i.e the next line) is being executed next.

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

    Awesome video