Question: CS - 3 0 3 Assignment 4 ( 2 5 points ) ( 1 5 points ) Draw an expression tree corresponding to each of

CS-303 Assignment 4
(25 points)
(15 points) Draw an expression tree corresponding to each of the following:
a) Inorder traversal is: xy+3**bc
b) Postorder traversal is: xyz+ab-c**-
c) Preorder traversal is: *+a-xycd
d) Considered the output of a to_string method below and show the tree that would be built by the following data lines is the binary search tree.
30
15
4
NULL
NULL
20
18
NULL
19
NULL
NULL
NULL
35
32
NULL
NULL
38
NULL
NULL
(10 points) Consider the graph above, starting from node A :
a) what is the finish order of the dept first search? (if two nodes can be reached from a node, give preference to one which is smaller).
b) what is the visit sequence of the Breadth first search. (if two nodes can be reached from a node give preference to one which is alphabetically smaller).
Submission guidelines:
For Question 1 and 2 provide the text document that has the respective tree and answers to any questions asked, and DFS and BFS traversals of the graph.
(15 points) Draw an expression tree corresponding to each of the following:
a) Inorder traversal is: xy+3**bc
b) Postorder traversal is: xyz+ab-c**-
c) Preorder traversal is: ?**+a-xycd
d) Considered the output of a to_string method below and show the tree that would be built by the following data lines is the binary search tree.
30
15
4
NULL
NULL
20
18
NULL
19
NULL
NULL
NULL
35
32
NULL
NULL
38
NULL
NULL
CS - 3 0 3 Assignment 4 ( 2 5 points ) ( 1 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!