CSE 2320
Name
____________________________________
Test 1
Fall 2006
Last 4 Digits of Student ID #
__________________
Multiple Choice.
Write your answer to the LEFT of each problem.
3 points each
1.
The time to compute the sum of the
n
elements of an integer array is:
A.
Θ
n
( )
B.
Θ
n
log
n
(
)
C.
Θ
n
2
æ
è
ç
ö
ø
÷
D.
Θ
n
3
æ
è
ç
ö
ø
÷
2.
What happens in the third phase of counting sort?
3.
Which of the following sorts is not stable?
4.
Suppose
H
n
=
137
60
.
What is the value of
n
?
5.
The function
2
n
+ log
n
is in which set?
A.
Ω
n
log
n
(
)
B.
Θ
log
n
(
)
C.
Θ
n
( )
D.
Θ
n
log
n
(
)
6.
Which of the following facts cannot be proven using one of the limit theorems?
7.
What is
n
, the number of elements, for the largest table that can be processed by binary search using no more than 7
probes?
8.
f n
( )
=
n
lg
n
is in all of the following sets, except
9.
The worstcase time for Q
UICKSORT
for
n
keys is in which set?
A.
Θ
log
n
(
)
B.
Θ
n
( )
C.
Θ
n
log
n
(
)
D.
Θ
n
2
æ
è
ç
ö
ø
÷
10.
How many inversions occur in the sequence
1
3
0
6
5
2
4
7?
11.
Suppose that you have correctly determined some
c
and
n
o
to prove that
g n
( )
Î W
f n
( )
(
)
.
Which of the following is not
necessarily true?
12.
Suppose you are using the substitution method to establish a
Θ
bound on a recurrence
T n
( )
and you already know that
T n
( )
Î Wlog
n
(
)
and
T n
( )
Î O
n
3
æ
è
ç
ö
ø
÷
.
Which of the following cannot be shown as an improvement?
13.
An array with 1000 unique elements is subscripted starting with 0.
You would like to iteratively use P
ARTITION
to find the
twenty largest values, but there is no requirement that the twenty largest values be ordered.
Which of the following is not
correct?
A.
If 978 is returned from P
ARTITION
, we are done.
B.
If 979 is returned from P
ARTITION
, we are done.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
C.
If 980 is returned from P
ARTITION
, we are done.
D.
If 981 is returned from P
ARTITION
, we must continue.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '12
 BOBWEEMS
 Graph Theory, d., B., c.

Click to edit the document details