0% found this document useful (0 votes)
58 views1 page

COM 211 (P100) Group B - Data Structures and Algorithm - CAT 2

Uploaded by

oscarfx94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views1 page

COM 211 (P100) Group B - Data Structures and Algorithm - CAT 2

Uploaded by

oscarfx94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

KARATINA UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS


COURSE: COM 211 - DATA STRUCTURES AND ALGORITHMS
CAT 2 (Take Away Practical)
For
P100 - BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY (GROUP B)
DATE: December 2024

Instructions: Attempt Any Two Questions. Duration One Week

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).

You might also like