Solution Key for Midterm Exam - Algorithm and Data Structures | ITCS 6114, Exams of Computer Science

Material Type: Exam; Class: Algorithm & Data Structures; Subject: Computer Science; University: University of North Carolina - Charlotte; Term: Fall 2007;

Typology: Exams

Pre 2010

Uploaded on 07/28/2009

koofers-user-iw6-1
koofers-user-iw6-1 🇺🇸

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
r
I
I
i
I .
i1
ITCS 6114/8114
Midterm Exam
Fall 2007
Name ke1
1. For each pair of the functions below, identify which one has higher rate of growth (or
state that both grow equally fast. Justify your answers. (5 pts. Each)
a. 10g2 n, 10&3 n
b 2" 3"
5I~g " 5log n
. 2, 3
d. log" n, nlog n
I
b.
L.
j.
<
)
pf3
pf4
pf5

Partial preview of the text

Download Solution Key for Midterm Exam - Algorithm and Data Structures | ITCS 6114 and more Exams Computer Science in PDF only on Docsity!

r II i I. i 1 ITCS 6114/ Midterm Exam Fall 2007

Name ke 1

  1. For each pair of the functions below, identify which one has higher rate of growth (or

state that both grow equally fast. Justify your answers. (5 pts. Each) a. 10g2 n, 10&3 n

b 2" 3"

C·. 5 I~g2, " 5 log 3 n d. log" n, nlog n I b. L. j. <

  1. Use recurrence relations to analyze the time complexities of Merge Sort. What are its time and space complexities? (15 pts)

I ,

\L20) .- .t 'm

'2-

'---^ -^ 'yy.^ .{-^ )

, .-.......,;;;~=:....;::=iiiiiiiiiiiiiii •

  1. a. Draw the top-down 2-3-4 tree that results ITom inserting into an initially empty tree records with the keys MID T E R M E X AM. (10 pts.) b. Draw a red-black implementation of the top-down 2-3-4 tree in part a. (10 pts.)

~

) Cf:

 _I_ ! 5. Give the contents of the hash table that results when keys E A S Y QUE S T ION are inserted in that order into an initially empty table of size 17 using linear probing. ### (Use h(kth letter) = k mod 17) (15 pts.) _'Y_ C9- U _t:_ S- _DO Lf-S-_ _I_ 1- _(j_ JY 3 ~ ,5' _lLf-_ ~J_@A\S~\E\T(Y~ ~ , 1- J 4- J _b_ 7 _g_ 7 _{D I_ ( 11. 13 f i(- IJ- If