CSE 2320
Name
____________________________________
Test 1
Fall 2010
Last 4 Digits of Mav ID # _____________________
Multiple Choice.
Write your answer to the LEFT of each problem.
3 points each
1.
The time to convert an array, with priorities stored at subscripts 1 through
n
, to a minheap is in:
A.
Θ
n
( )
B.
Θ
log
n
(
)
C.
Θ
n
3
æ
è
ç
ö
ø
÷
D.
Θ
n
log
n
(
)
2.
The number of calls to
mergeAB
while performing
mergesort
on
n
items is:
3.
Which of the following is not true?
4.
The cost function for the optimal matrix multiplication problem is:
5.
The function
n
+ 3
n
2
log
n
is in which set?
A.
Ω
n
2
æ
è
ç
ö
ø
÷
B.
Θ
log
n
(
)
C.
Θ
n
( )
D.
Θ
n
log
n
(
)
6.
f n
( )
=
n
lg
n
is in all of the following sets, except
7.
Which statement is correct regarding the unweighted and weighted activity scheduling problems?
8.
What is the value of
2
k
k
=0
t
å
?
9.
Suppose you have correctly determined some
c
and
n
o
to prove
f n
( )
Î O
g n
( )
(
)
.
Which of the
following is not necessarily true?
A.
c
may be increased
B.
n
o
may be decreased
C.
n
o
may be increased
D.
g n
( )
Î W
f n
( )
(
)
10. Suppose you are using the substitution method to establish a
Θ
bound on a recurrence
T n
(
) and that
you already know that
T n
( )
Î Wlg
n
(
) and
T n
( )
Î O
n
2
æ
è
ç
ö
ø
÷
.
Which of the following cannot be shown
as an improvement?
11. The time to find the maximum of the
n
elements of an integer array is in:
12. Which sort takes worstcase
Θ
n
2
æ
è
ç
ö
ø
÷
time and is not stable?
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Short answer.
3 points each
1.
Give the exact value of
H
4
.
2.
What is
n
, the number of elements, for the largest table that can be processed by binary search using
no more than 10 probes?
3.
Give the subscripts for the parent, left child, and right child for the maxheap element stored at
subscript 455.
The heap is currently storing 1000 elements in a table with 2000 slots.
Long Answer
1.
Give the definition of
Ω
.
5 points
2.
Use dynamic programming to solve the following instance of weighted interval scheduling.
Be sure
to indicate the intervals in your solution and the sum achieved.
10 points
1
6
11
16
21
26
1
2
3
4
5
6
7
8
9
10
v
i
p
i
1
0
5
0
3
2
8
1
1
4
2
4
3
5
1
6
4
6
1
8
m
(
i
)
3.
Use the recursiontree method to show that
T n
( )
= 2
T
n
4
(
)
+ 2
is in
Θ
n
(
)
.
10 points
4.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '12
 BOBWEEMS
 Graph Theory, B.

Click to edit the document details