Mid-Term examination question paper set for Data Structures and Algorithms.
Tribhuvan University
Faculty of Humanities & Social Sciences
OFFICE OF THE DEAN
2025
Bachelor in Computer Applications
| Paper detail | Value |
|---|---|
| Course | Data Structures and Algorithms |
| Code No. | CACS201 |
| Semester | IIIrd |
| Full marks | 60 |
| Pass marks | 24 |
| Time | 3 hours |
Candidates are required to answer the questions in their own words as far as possible.
Group B
2. Define stack. List any four applications of stack. Trace the algorithm to convert infix to postfix for following infix expression ((A+B)−C∗D/E)∗(H−I)∗F+G((A+B)-CD/E)(H-I)*F+G((A+B)−C∗D/E)∗(H−I)∗F+G and evaluate the obtained postfix expression with following values: A=4,B=2,C=4,D=3,E=8,F=2,G=3;H=5,I=1A=4, B=2, C=4, D=3, E=8, F=2, G=3; H=5, I=1A=4,B=2,C=4,D=3,E=8,F=2,G=3;H=5,I=1.
3. What are the disadvantages of linear queue? Write an algorithm to insert and remove data items for circular queue with conditions including queue full and empty with an example.
4. What is Doubly linked list? Write an algorithm to add a node at the kthk^{th}kth position of Doubly linked list.
5. What is Tail Recursion? Write an algorithm to TOH with 'n' disks using recursion.
6. What is an AVL tree. Create an AVL tree from the following data: 18, 12, 14, 8, 5, 25, 31, 24, 27.
7. What is heap? Differentiate between min heap and max heap. Sort the following data in ascending order by head method: 2, 9, 2, 12, 15, 8, 11.
8. Explain about Serial and Parallel algorithm with their differences.
Group C
9. What is spanning tree of graph? Explain about adjacency matrix in graph. Find the minimal spanning tree of the following graph using Prim's algorithms.
10. How Collision occurs? What are the techniques used for collision resolution in hashing? Insert the keys: 62, 37, 36, 44, 67, 91, 82, and 31 using quadratic probing method. The hash function is: h(key)=keypmod10h(key) = key \\\\pmod{10}h(key)=keypmod10 (where 10 is the table size).
11. Define graph traversal. Explain in brief about BFS and DFS concept. Find the shortest path from source vertex A to other vertices using Dijkstra's algorithm.