CS 612 Exam 1
Fall 2009
Name _
Your grade is based on your best 5 answers to these 6 problems.
1. A sequence of n operations is performed on a data structure. The kth operation has
cost
when k is a perfect square (such as 1,4,9,16,25,.) and otherwise its
CS 612 Exam 5
Fall 2009
Name _
1. Draw a two-level perfect hashing scheme for keys cfw_1, 4, 6, 9, 10. Let the primary hash
function be h(k) = (10k+9)%11)%5. Specify which secondary hash functions you choose.
2. Write an efficient algorithm that uses a tr
CS 612 Exam 4
Fall 2009
Solution
Your grade is based on your best 5 answers to these 6 problems. It is not
necessary to provide details of any balanced search tree (AVL, red-black, etc).
Just assume that each search tree is as balanced as possible.
1. Dra
CS 612 Exam 4
Fall 2009
Name _
Your grade is based on your best 5 answers to these 6 problems. It is not
necessary to provide details of any balanced search tree (AVL, red-black, etc).
Just assume that each search tree is as balanced as possible.
1. Draw
CS 612 Exam 3
Fall 2009
Solution
Your grade is based on your best 5 answers to these 6 problems.
1. Given the leftist heap shown below:
a. Write the ranks beside each node.
b. Redraw the heap after inserting key 17, and update the ranks.
c. Redraw the hea
CS 612 Exam 3
Fall 2009
Name _
Your grade is based on your best 5 answers to these 6 problems.
1. Given the leftist heap shown below:
a. Write the ranks beside each node.
b. Redraw the heap after inserting key 17, and update the ranks.
c. Redraw the heap
CS 612 Exam 2
Fall 2009
Solution
Your grade is based on your best 5 answers to these 6 problems.
1. Draw these two kinds of trees such that each contains these 13 (key, object) pairs:
cfw_(1,A),(2,B),(3,C),(4,D),(5,E),(6,F),(7,G),(8,H),(9,I),(10,J),(11,K)
CS 612 Exam 2
Fall 2009
Name _
Your grade is based on your best 5 answers to these 6 problems.
1. Draw these two kinds of trees such that each contains these 13 (key, object) pairs:
cfw_(1,A),(2,B),(3,C),(4,D),(5,E),(6,F),(7,G),(8,H),(9,I),(10,J),(11,K),(
CS 612 Exam 1
Fall 2009
Solution
Your grade is based on your best 5 answers to these 6 problems.
1. A sequence of n operations is performed on a data structure. The kth operation has
cost
when k is a perfect square (such as 1,4,9,16,25,.) and otherwise it
CS 612 Exam 5
Fall 2009
Solution
1. Draw a two-level perfect hashing scheme for keys cfw_1, 4, 6, 9, 10. Let the primary hash
function be h(k) = (10k+9)%11)%5. Specify which secondary hash functions you choose.
Most students solved this problem mostly cor