MHB Algorithm Type: Postorder Tree | Correct?

  • Thread starter Thread starter barbara
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
The discussion centers around identifying the structure and computation of a postorder tree. The computation is suggested to be expressed as (2*3)+((4*2)-(1+5)), which is confirmed as correct. Participants clarify the distinction between a postorder tree and postorder traversal, with some confusion regarding the existence of left or right subtrees. The conversation also touches on the relationship between postorder trees and concepts of recursion and repetition. Overall, the focus remains on understanding the postorder tree structure and its computational implications.
barbara
Messages
10
Reaction score
0
+

/ \

/ \

* -

/ \ / \

2 3 * +

/ \ / \

4 2 1 5


What type of algorithm is this I think the computation can be expressed as (2*3)+((4*2)-(1+5)). is this correct. I know its a postorder tree I just don't know if a left or right subtree exists Print root end. Does it anything to do with recursion or repetition
 
Last edited:
Physics news on Phys.org
Code:
           +

       /       \

      /         \

      *            -

     /  \       /     \

    2   3      *       +

             /  \     /  \

            4   2    1   5

barbara said:
What type of algorithm is this
This is not an algorithm.

barbara said:
I think the computation can be expressed as (2*3)+((4*2)-(1+5)).
Yes.

barbara said:
I know its a postorder tree
What is a postorder tree? I know what a postorder traversal is, but not sure about a postorder tree.

barbara said:
I just don't know if a left or right subtree exists Print root end.
I can't parse this sentence.

barbara said:
Does it anything to do with recursion or repetition
There is some connection.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
3
Views
1K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K