If the root is a max node the value of the tree is equal to


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 minimax tree and has a value, which we defi ne 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 subtree, but only if it is nonempty

• The value of the right subtree, 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 minimax tree in Figure 15-21. Each node is labeled with its initial value.

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

1180_88743961-42a5-4acb-a015-5917674581f9.png

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: If the root is a max node the value of the tree is equal to
Reference No:- TGS01422332

Expected delivery within 24 Hours