MHB Algorithm Type: Postorder Tree | Correct?

  • Thread starter Thread starter barbara
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread 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.
 
I was reading a Bachelor thesis on Peano Arithmetic (PA). PA has the following axioms (not including the induction schema): $$\begin{align} & (A1) ~~~~ \forall x \neg (x + 1 = 0) \nonumber \\ & (A2) ~~~~ \forall xy (x + 1 =y + 1 \to x = y) \nonumber \\ & (A3) ~~~~ \forall x (x + 0 = x) \nonumber \\ & (A4) ~~~~ \forall xy (x + (y +1) = (x + y ) + 1) \nonumber \\ & (A5) ~~~~ \forall x (x \cdot 0 = 0) \nonumber \\ & (A6) ~~~~ \forall xy (x \cdot (y + 1) = (x \cdot y) + x) \nonumber...

Similar threads

Replies
3
Views
2K
Replies
3
Views
2K
Replies
4
Views
1K
Replies
4
Views
1K
Replies
16
Views
2K
Replies
1
Views
1K
Replies
5
Views
2K
Replies
6
Views
2K
Back
Top