Design a general solution for representing and evaluating


Exercise 13 in Chapter 15 introduced the mini max tree. It has min nodes and max nodes. Part b of the exercise asked you to design a solution for representing and evaluating these trees. Implement your design in C++.

Chapter 15 Exercise 13:

Consider a nonempty binary tree with two types of nodes: min nodes and max nodes . Each node has an integer value initially associated with it. This tree is a mini max tree and has a value, which we define as follows:

• If the root is a min node, the value of the tree is equal to the minimum of

• The integer stored in the root

• The value of the left sub tree, but only if it is nonempty

• The value of the right sub tree, but only if it is nonempty

• If the root is a max node, the value of the tree is equal to the maximum of the above three values.

a. Compute the value of the mini max tree in Figure 15-21. Each node is labeled with its initial value.

b. Design a general solution for representing and evaluating these trees.

635_c5f1552e-5383-4ebe-b737-e128668134cb.png

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Design a general solution for representing and evaluating
Reference No:- TGS01422164

Expected delivery within 24 Hours