Homework #7 -- due Monday Wk 9

# required problems topic
1 CLR Exercise 23.1-1 on page 566 minimum spanning tree
2 CLR Exercise 22.3-7 on page 548 depth first search
3 In a binary tree, the balance ratio of node v, bal(v), is the number of nodes in the left subtree of node v divided by the sum of the number of nodes in the right and left subtrees of node v.  A tree T is said to be ε-balanced if, for all nodes v in T,
½ - ε < bal(v) < ½ + ε.
Use depth-first search to help design an efficient algorithm to determine whether a binary tree is ε-balanced.
depth first search
4 (Baase Exercise 7.42 on page 383)
Suppose G is a connected graph.  An edge e whose removal disconnects the graph is called a bridge.  Give an linear-time algorithm for finding the bridges in a graph.  Express your solution in prose, not in pseudocode.
biconnected components

# suggested problems topic
5 Give an algorithm that determines whether a given undirected graph G = (V,E) is a tree.  Analyze the worst-case computational complexity of your algorithm. graph algorithm - tree
6 Use depth-first search to help design an efficient algorithm to test whether a directed graph is acyclic. depth first search
7 CLR Exercise 22.3-10 on page 549 depth first search
8 CLR Exercise 22.5-7 on page 557 connectivity
9 What is the maximum and minimum number of articulation points possible in graphs on n vertices?  Give examples. articulation points
10 Baase Exercise 7.33 on page 381 biconnected components
11 Baase Exercise 7.41 on pages 383 biconnected components
12 Baase Exercise 7.43 on page 383 graph algorithm - sink
13 Baase Exercise 7.49 on page 384 graph algorithm - tree split
14 Height-balanced trees are binary trees in which the balance factor (the difference in heights of the right and left subtrees) of each node has absolute value at most 1.

Consider the following extension. Define HB(k) to be the set of binary trees in which the balance factor of each node has absolute value at most kHB(0) is the set of complete binary trees.  HB(1) is the set of AVL (or height-balanced) trees.

  1. What is the minimum number of nodes in HB(3) trees of height 15?  Do not draw any trees but indicate how you arrived at your answer.
  2. What is the minimum number of leaves in HB(3) trees of height 15?  Do not draw any trees but indicate how you arrived at your answer.
  3. What can you say about the asymptotic time complexity of searching an HB(3) tree?  Justify your answer.
analysis
15 DPV exercise 5.7 on p.149
Show how to find the maximum spanning tree of a graph, that is, the spanning tree of largest total weight.
minimum spanning tree
16 DPV exercise 5.28 on p.153
Alice wants to throw a party and is deciding whom to call. She has n people to choose from, and has made up a list of which pairs of these people know each other. She wants to pick as many people as possible, subject to two constraints: at the party, each person should have at least five other people whom they know and five other people whom they don't know.

Give an efficient algorithm that takes as input the list of n people and the list of pairs who know each other, and outputs the best choice of party invitees. Give the running time in terms of n.

algorithm design


Dan Hirschberg
Computer Science Department
University of California, Irvine, CA 92697-3435
dan at ics.uci.edu
Last modified: Jun 18, 2008