Chapter 9: Problem 13
Evaluate each vertex in each game tree. The values of the terminal vertices are given.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 9: Problem 13
Evaluate each vertex in each game tree. The values of the terminal vertices are given.
All the tools & learning materials you need for study success - in one app.
Get started for free
Draw all nonisomorphic binary trees having four vertices.
Refer to tournament sort. Tournament Sort. We are given a sequence \(s_{1}, \ldots, s_{2^{k}}\) to sort in nondecreasing order. We will build a binary tree with terminal vertices labeled \(s_{1}, \ldots, s_{2^{k}} .\) An example is shown. Working left to right, create a parent for each pair and label it with the maximum of the children. Continue in this way until you reach the root. At this point, the largest value, \(m\), has been found. To find the second-largest value, first pick a value vless than all the items in the sequence. Replace the terminal vertex w containing \(m\) with \(v\). Relabel the vertices by following the path from w to the root, as shown. At this point, the secondlargest value is found. Continue until the sequence is ordered. Show that any algorithm that finds the largest value among \(n\) items requires at least \(n-1\) comparisons.
Write an algorithm based on breadth-first search that finds the minimum length of each path in an unweighted graph from a fixed vertex \(y\) to all other vertices.
The subset-sum problem is: Given a set \(\left\\{c_{1}, \ldots, c_{n}\right\\}\) of positive integers and a positive integer \(M,\) find all subsets \(\left\\{c_{k_{1}}, \ldots, c_{k_{j}}\right\\}\) of \(\left\\{c_{1}, \ldots, c_{n}\right\\}\) satisfying $$\sum_{i=1}^{j} c_{k_{i}}=M$$ Write a backtracking algorithm to solve the subset-sum problem.
Write a breadth-first search algorithm to test whether a graph is connected.
What do you think about this solution?
We value your feedback to improve our textbook solutions.