School of Computer Science Engineering and Information
Systems
BITE201P- Data Structures and Algorithms Lab
Cycle Sheet 1
1. Balanced Parenthesis Checker:
a. Low-level: Write a stack -based program that checks whether the
brackets in a string are balanced. The string can contain (), {},
and []. No other processing is required.
b. Medium-level: Write a C program that takes a small C code snippet
as input and verifies whether the brackets: round (), curl y {}, and
square [] are properly balanced and nested. The program should
use a stack to manage the brackets and return whether the syntax
structure is correct in terms of these symbols.
c. High-level: You are given a parentheses string‘s’. In one move,
you can insert a parenthesis at any position of the string .
Return the minimum number of moves required to make‘s’ valid.
2. Tower of Hanoi :
a. Low-level: Write a recursive C program to solve the Tower of
Hanoi problem for ‘n’ disks. Print the steps to move each disk
from the source rod to the destination rod using a temporary rod.
b. Medium-level: Count and print the total number of moves
required.
c. High-level: Implement Tower of Hanoi without recursion , by
using explicit stacks to represent the three rods (A, B, C) and
simulate the movement of disks iteratively.
3. Bank Queue Simulation:
a. Low-level: Write a C program to simulate a bank queue system
using a normal linear queue (array). The operations should include
i. Enqueue: Add a customer to the queue
ii. Dequeue: Serve the customer at the front
iii. Display: Print current queue.
There can be a maximum of 10 customers in the queue. Overflow
and underflow cases must be handled.
b. Medium-level: Write a C program to simulate a bank queue system
using a normal linear queue (array). Each customer has a Customer
ID and name. The operations should include:
i. Enqueue: Add a customer to the queue
ii. Dequeue: Serve the customer at the front
iii. Display: Print current queue.
There can be a maximum of 10 customers in the queue. Overflow
and underflow cases must be handled. During every operation,
display which customer is currentl y being s erved.
c. High-level: Re-implement the bank queue using a circular queue
to avoid memory wastage when customers are served.