Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

EAST WEST UNIVERSITY

Department of Computer Science and Engineering


B.Sc. in Computer Science and Engineering Program
Final Examination, Summer 2023 Semester
Course: CSE 207- Data Structures, Section-2
Instructor: Dr. Maheen Islam, Associate Professor, CSE Department
Full Marks: 40 (20 will be counted for final grading)
Time: 1 Hour and 20 Minutes

Note: There are FIVE questions, answer ALL of them. Course Outcome (CO), Cognitive Level and Mark
of each question are mentioned at the right margin.

1. Suppose, you are running a hospital and patients are coming in. There is only one doctor [CO3,C3,
on staff to serve the patients. Patients visiting the hospital can broadly be classified as Mark: 8]
requiring one or more of the following categories of care:
Category 1: major trauma care
Category 2: critical care cases
Category 3: non-critical and minor care
Category 4: non-emergency or primary care
Category 5: Routine checkups.
Consider at a particular instance of time, 8 patients arrive in order with the priorities-
5, 3, 4, 2, 1, 3, 1 and 2. Now build a Binary Heap using the priority number.

b. Next, delete the top four priority patients from the heap and perform necessary operations
to rebuild the heap after deletion.

2. a. Write a function to find the path between a pair of vertices where the graph is stored in [CO3,C3,
an adjacency matrix. Input the pair of vertices and print the path along with the path length. Mark: 8]

b. Write a function to find the out-degree of a single vertex whose graph is stored in an [CO3,C3,
adjacency list. Mark: 8]

3. Show breadth-first traversal of the following graph, where A is the starting node. Visit [CO3,C3,
adjacent nodes in a counterclockwise ordering from a particular node (12 o’clock position). Mark: 4]

4. The following undirected, weighted graph shows the time in minutes to travel between 7 [CO3,C3,
towns. Use Dijkstra's algorithm to calculate minimum time to travel from town A (show Mark: 4]
detailed steps) to other town and also show the corresponding routes.

Page 1 of 2
5. a. Find the index of the given items in 15- element hash table. To insert the [CO2,C3,
item k, use the hash function k % TableSize and resolve collisions with Mark: 8]
Double Hashing. Insert: 74, 924, 83, 113 and 147.
b. Now consider looking up some items that are not in the table after doing the
insertions above. For each, give the list of buckets that are looked at in order
before determining that the item is not present. Include all the buckets
examined, whether or not they contain an item.
i. 164 ii. 176

Page 2 of 2

You might also like