Wachemo University
College of Engineering and Technology
Department of Software Engineering
Assignment of Data Structure and Algorithms
Target Group 2nd Year Software Engineering Student Max Mark: - 20%
1. Write a C++ program to implement a circular linked list. The program should include the
following operations:
Insert a node at the beginning. Delete a node from any specified
Insert a node at any specified position.
position. Delete a node from the end.
Insert a node at the end. Display the circular linked list.
Delete a node from the beginning. Allow the user to choose the
operation via a menu.
2. Write a single C++ program that can:
Convert infix to postfix.
Convert postfix back to infix.
Allow the user to choose the operation via a menu.
3. Write a single C++ program that can:
Convert infix to prefix.
Convert prefix back to infix.
Allow the user to choose the operation via a menu.
4. Write a C++ program to evaluate a given postfix expression (e.g., 5 3 2 * +) and return the result.
Assume the expression contains integers and basic operators (+, -, *, /).
Validate the input and handle division by zero appropriately.
5. Write a C++ program to evaluate a given prefix expression (e.g., * +5 3 2) and return the result.
Assume the expression contains integers and basic operators (+, -, *, /).
Validate the input and handle division by zero appropriately.
6. Write a C++ program to delete a node in a binary search tree (BST) using the deletion by
merging method.
7. Write a C++ program to perform Breadth-First Search (BFS) on a directed graph. Implement the
following:
Input the graph as an adjacency matrix.
Perform BFS starting from a given source node.
Print the nodes in the order they are visited.
8. Write a C++ program to perform Depth First Search (DFS) on a directed graph. Implement the
following:
Input the graph as an adjacency matrix.
Perform DFS starting from a given source node.
Print the nodes in the order they are visited.