Docsity

Directed Graph - Efficient Algorithms and Intractable Problems - Exams, Exams of Algorithms and Programming

Toggle sidebar
bg1
CS 170 (Clancy) Exam 1
October 12, 2000
A1
Read and fill in this page now.
Do NOT turn the page until you are told to do so.
This is an open-book test. You have approximately eighty minutes to complete it. You
may consult any books, notes, or other paper-based inanimate objects available to
you. To avoid confusion, read the problems carefully. If you find it hard to understand
a problem, ask us to explain it. If you have a question during the test, please come to
the front or the side of the room to ask it.
This exam comprises 15% of the points on which your final grade will be based. Par-
tial credit may be given for wrong answers. Your exam should contain six problems
(numbered 0 through 5) on seven pages. Please write your answers in the spaces pro-
vided in the test; in particular, we will not grade anything on the back of an exam
page unless we are clearly told on the front of the page to look there.
Relax—this exam is not worth having heart failure about.
Your name:
Your login name on the EECS instructional
computers:
Your discussion section day and time:
Your discussion t.a.:
Name of the person sitting to your left:
Name of the person sitting to your right:
Problem 0 Total: /30
Problem 1
Problem 2 Problem 4
Problem 3 Problem 5
pf3
pf4

Partial preview of the text

Download Directed Graph - Efficient Algorithms and Intractable Problems - Exams and more Exams Algorithms and Programming in PDF only on Docsity!

CS 170 (Clancy) Exam 1 October 12, 2000

Read and fill in this page now. Do NOT turn the page until you are told to do so.

This is an open-book test. You have approximately eighty minutes to complete it. You may consult any books, notes, or other paper-based inanimate objects available to you. To avoid confusion, read the problems carefully. If you find it hard to understand a problem, ask us to explain it. If you have a question during the test, please come to the front or the side of the room to ask it.

This exam comprises 15% of the points on which your final grade will be based. Par- tial credit may be given for wrong answers. Your exam should contain six problems (numbered 0 through 5) on seven pages. Please write your answers in the spaces pro- vided in the test; in particular, we will not grade anything on the back of an exam page unless we are clearly told on the front of the page to look there.

Relax—this exam is not worth having heart failure about.

Your name:

Your login name on the EECS instructional computers:

Your discussion section day and time:

Your discussion t.a.:

Name of the person sitting to your left:

Name of the person sitting to your right:

Problem 0 Total: /

Problem 1

Problem 2 Problem 4

Problem 3 Problem 5

Problem 0 (1 point, 1 minute)

Put your name on each page. Also make sure you have provided the information requested on the first page.

Problem 1 (3 points, 10 minutes)

Consider the following two recurrences.

Circle all the true statements in the list below, and justify your answers.

S(n) = O(T(n)) T(n) = O(S(n)) S(n) = Ω(T(n))

S n( ) 2S n 4  ---^ 2n^

2 = + n

T n( ) 9T n 2  ---^ 3n^

2 = +

Problem 4 (8 points, 24 minutes)

Two CS 170 students have a jug filled with eight liters of Jolt Cola that they wish to divide evenly between them. They have two empty jugs with capacities of five and three liters respectively. These jugs are unmarked and no other measuring device is available. They wish to know how they can most quickly (i.e. in the fewest number of pours) accomplish the equal division.

This problem may be solved using breadth-first search (CLR page 470) on a graph. Describe the vertices and edges of this graph in detail sufficient for a CS 170 student unfamiliar with the problem to be able to construct the graph immediately. Don’t draw the graph; just describe its vertices and edges in English. Also explain what ver- tex is used to initialize the breadth-first search, and how to determine the answer once the breadth-first search is completed.

Problem 5 (4 points, 10 minutes)

Part a

The minimum spanning tree represented by the dark edges in the graph below was produced by Prim’s algorithm when starting at the circled vertex. Circle the last edge added to the spanning tree, and briefly explain your answer.

Part b

The minimum spanning tree represented by the dark edges in the graph below was produced by Kruskal’s algorithm. Circle the last edge added to the spanning tree, and briefly explain your answer.