final-dsa-to-students-rbrbff
final-dsa-to-students-rbrbff
Algorithms and Data Structures (Trường Đại học Quốc tế, Đại học Quốc gia Thành phố
Hồ Chí Minh)
Final Examination
Date: 16/06/2021; Duration: 120 minutes
Online, Open-book
Full name: Dr. Nguyen Van Sinh Full name: Trần Thanh Tùng
Proctor 1 Proctor 2
Signature Signature
STUDENT INFO
Student name:
Student ID:
Note: For all calculations in this subject, the following rounding convention is used: 7/2 = 4
1/3
STARTING A B C D E
NODE
For all lists of items in the following sessions, take items from left to right starting from your
OFFSET. If the end of the list is reached before all items are taken, continue from index 0 (wrap
around).
Given a list of items, take items one by one using your list iteration procedure.
Table 1 - Items
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
45 30 80 20 35 70 90 25 21 39 37 38 75 78 76 90
1.a. Insert all items into a binary search tree and draw the tree (15pts)
1.b. Delete the root node and redraw the tree (10pts)
2. Hash table (20pts)
Given a list of items in table 1, take items using your list iteration procedure.
2.a. Insert all items into the hash table of size 27 by using the linear probing algorithm to solve
collisions (10pts).
2.b. Change the hash table’s size to 31, redraw it (10pts)
3. Graph - Elementary Algorithms (30pts)
3.a Given the graph GS in Fig. 1, run the DFS algorithm from your STARTING NODE and
redraw the graph with the discovery time and the finishing time for each node. (15pts)
3.b. Find all strongly connected components in Gs and draw the Gs-1 with the finishing time for
each node(15pts)
2 /3
Fig. 1: Graph GS
- (10pts) Propose an algorithm (write a pseudo-code) based on the DFS algorithm to print
out all the backward edges of a given graph starting from a source node.
3 /3