You are on page 1of 8

Final Exam: CMPSCI3130

Note: Check grade points against each question and manage your time accordingly.

Name………………………………………………. Date…………………………………………….

1. Which of the following recurrence relation represent the average time complexity of QuickSort and why?
Explain
T(n) = T(1/4*n)+ T(3/4*n)+n (1)
T(n) = 4T(n/2)+n3
T(n) = 4T(n/2)+n2

2. Which data structure is used in implementing authentication algorithms? How it is different from direct
tables? (1)
3. Why height balanced binary search tree are more useful than simple binary search tree? (2+4)

Which operations are used in Red Black tree to make it height balanced tree? Show those operations

Create a Red black tree for following sequence

18,9,12,14,6,15,17,3,2,1,24,25,26
4. Why counting sort is not used in sorting even though its time complexity is O(N). (1)

5. Which data structure is used in job scheduling problem? Show the time complexity of all operations? (1)
6. In the Given B-Tree of Order 5,Insert following numbers 9,13,14,15,16,17,49.From the Final B-Tree,remove
numbers 3,4,11,21,27and 67. (5)
7. We are running depth-first search on the graph below and assuming that the searches visit the neighbors of a node
and the sources in numerical order (smaller first). (3)

a. Draw the breadth-first search tree starting from vertex 1.

1 4 5

b. What will be the result of DFS if node 2 is chosen?


7
6

3 8
9
2

1 4 5

7
6

8
9
8. We are running one of the two algorithms on the graph below. (ignore the directions on the edges for Prim's
and Kruskal's).

a. Show the order of nodes that are added to the partial solution by the Prim’s algorithm starting from node 1.
b. What is the sequence of edges added by Kruskal's algorithm? (2+2)

10
1 4

5 14
7 12

3
2
9
9. Use Hash function h(k)=(4*m+5) mod 10 to store key values 67 46 88 91 123 141 152 155 178 288 in Hash
Table. Draw a diagram to show how the values are inserted into a hash table with 10 positions. Use linear probing to
avoid collisions. (3)
END

You might also like