An Algorithm

  • MHB
  • Thread starter barbara
  • Start date
  • #1
barbara
10
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:

Answers and Replies

  • #2
Evgeny.Makarov
Gold Member
MHB
2,437
929
Code:
           +

       /       \

      /         \

      *            -

     /  \       /     \

    2   3      *       +

             /  \     /  \

            4   2    1   5

What type of algorithm is this
This is not an algorithm.

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

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.

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

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

Suggested for: An Algorithm

  • Last Post
Replies
3
Views
563
Replies
1
Views
453
Replies
3
Views
1K
  • Last Post
Replies
3
Views
953
  • Last Post
Replies
1
Views
699
  • Last Post
Replies
1
Views
892
  • Last Post
Replies
2
Views
780
  • Last Post
Replies
1
Views
1K
Replies
2
Views
861
Top