



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A university exam about various computer science topics such as asymptotic notation, recurrence relations, lists, sorting, hashing, and binary search trees. It includes true or false questions, recurrence relation problems, running time analysis of list operations, sorting algorithms comparison, hashing algorithms with different conflict resolution methods, and binary search tree problems.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




(a) 8 log n = Ω(
n) (b) 8f (n) · 2 g(n) = O(f (n) · g(n)) (c) f (n) · g(n) = O(max(f (n), g(n))) (d) 2n log n^2 = Θ(n log n) (e) f g^ ((nn)) = O(1) if f (n) = Θ(g(n))
int F( int N ) { if ( N == 0 || N == 1 ) return 1; else return F( N-1 ) * F( N-2 ); }
(a) Write a recurrence relation which represents its running time.
(b) Use a recursion tree to argue a bound for this relation.
(a) Insert at the front of the list.
(b) Insert at the end of the list.
(c) Find the item with value X.
(d) Find item number k in the list.
(e) Delete item number k from the list.
i. Edgar Kalns (69 100 103 97 114 32 75 97 108 110 115) ii. Frank Northrup (70 114 97 110 107 32 78 111 114 116 104 114 117 112) iii. Honda Shing (72 111 110 100 97 32 83 104 105 110 103) iv. Bill Moore (66 105 108 108 32 77 111 111 114 101) v. Travis Doom (84 114 97 118 105 115 32 68 111 111 109) vi. Jen White (74 101 110 32 87 104 105 116 101)
(a) Open hashing (with a linked list per bin) is used to resolve conflicts. The function h 1 (k), as defined above is used for hashing.
(b) Quadratic probing is used to resolve conflicts. The function h 2 (k), as defined above, is used for hashing.
(c) Double hashing is used to resolve conflicts. Both h 1 (k) and h 2 (k), as defined above, are used.
(d) List one problem with this algorithm and suggest a modification which fixes it.
(b) List the preorder traversal of the above tree.