COM 211 (P100) Group B - Data Structures and Algorithm - CAT 2
COM 211 (P100) Group B - Data Structures and Algorithm - CAT 2
1. Implement a program that uses an array to store students’ grades. Write functions to sort the
grades using Bubble Sort and search for a specific grade using Linear Search.
2. Write a program to reverse a linked list. Explain the time complexity of your approach.
3. Implement a doubly linked list with functions to traverse it both forwards and backwards.
4. Write a program that simulates a bank queue where people join the queue and are served in
the order they arrive
5. Write a program that uses a stack to check if a given string of parentheses is balanced (e.g.,
"((()))" is balanced, but "(()" is not).
6. Write a function to search for a specific value in the tree using Breadth-first search (BFS). Test
the function with sample data.
7. Use a binary search tree (BST) to store and manage student IDs in a university system.
Program Requirements:
i. Write functions to insert, search, and delete student IDs in the BST.
ii. Implement an in-order traversal to print the student IDs in ascending order.
iii. Test your program by inserting the following IDs:
1023, 1005, 1089, 1044, 1001
iv. Explain how the height of the tree affects search efficiency. What is the worst-case
time complexity for search in a binary search tree?
8. Write a program to represent a weighted, undirected graph using an adjacency matrix or
adjacency list. Use this graph to implement Prim’s algorithm to find the Minimum
Spanning Tree (MST).