N Nexsus

PRINCIPLES OF DATA STRUCTURES — Major (End Semester) 2025 question paper

MMMUT Computer Science and Engineering previous year question paper for PRINCIPLES OF DATA STRUCTURES (BCS-214), semester 3, Major (End Semester) 2025. All 19 questions are listed below, each with a written answer on Nexsus.

Paper details

  • Subject: PRINCIPLES OF DATA STRUCTURES (BCS-214)
  • Branch: Computer Science and Engineering
  • Semester: 3
  • Exam: Major (End Semester) 2025
  • Questions: 19

Questions asked in PRINCIPLES OF DATA STRUCTURES Major (End Semester) 2025

  1. Q1(a). Find out the transformation function to store the below sparse matrix into a linear array. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [2 marks]
  2. Q1(b). Write a function in C to create a singly linked list of n elements. [2 marks]
  3. Q1(c). Consider the following arithmetic expression written in postfix notation and evaluate it. 1 2 3 * 4 5 / + 1 6 7 * + - 8 2 5 * + / [2 marks]
  4. Q1(d). Write a function in C to delete the middle element of a the singly linked list. [2 marks]
  5. Q1(e). Write function in C to reverse the elements of a queue. [2 marks]
  6. Q1(f). Briefly explain the following types of Queues- I. Priority Queue II. Circular Queue [2 marks]
  7. Q1(g). Explain the polynomial representation using linked list. [2 marks]
  8. Q2(a). Write the mathematical formula to calculate following with example. I. To print only even values leaf nodes of a binary tree. II. To find the sum of all nodes of a binary tree. [5 marks]
  9. Q2(b). Suppose the following sequences list the nodes of a binary tree T in Post-order and In-order respectively. Post-Order: H, I, D, J, K, E, B, L, M, F, N, P, O, G, C, A In-Order: H, D, I, B, J, E, K, A, L, F, M, C, N, G, P, O Draw the corresponding binary tree with respect to the above traversals. [5 marks]
  10. Q2(c). Write a C function to find the In-Order successor an element of a binary search tree. Also, draw a binary search tree by inserting the following element into an empty binary search tree. 50, 33, 44, 22, 77, 35, 60, 40, 1, 3, 5, 21, 25 [5 marks]
  11. Q3(a). Write a function in C to print level order traversal of binary tree from bottom to top. For example, suppose the following binary tree and its level order traversal from bottom to top is- H, I, D, E, F, G, B, C, A [Tree structure: Root A has children B and C. B has children D and E. C has children F and G. E has children H and I.] [5 marks]
  12. Q3(b). Write a function in C to print the iterative version of Post Order traversal of a binary tree. Also write the post order traversal of following binary tree. [Tree structure: Root 25. Left child 20, Right child 36. 20 has children 10 and 22. 36 has children 30 and 40. 10 has children 5 and 12. 30 has child 28. 40 has children 38 and 48. 5 has children 1 and 8. 12 has child 15. 48 has children 45… [5 marks]
  13. Q3(c). What is AVL Tree? Consider a modified AVL tree that allows balance factor from -2 to +1 for each node. Draw the modified AVL tree by inserting the following elements from empty AVL tree. 1, 3, 2, 10, 20, 30, 40, 35, 38, 50, 49, 48, 60, 55 [5 marks]
  14. Q4(a). Suppose that there exists an array in such a way that first quartile of array is sorted, second quartile is unsorted, third quartile is sorted while last quartile is unsorted. Write a function in C/C++ to efficiently search for an item in the above array. Example of such array is- [1, 2, 3, 6, 11, 5, 16, 17, 18, 9, 8, 20] [5 marks]
  15. Q4(b). Write a C function to sort numbers in descending order using Heap sort. [5 marks]
  16. Q4(c). What is hashing? Explain hash functions and collision resolution strategies with an example. [5 marks]
  17. Q5(a). Write a function in C to implement the merge sort. [5 marks]
  18. Q5(b). Write the algorithm for the Breadth First Search traversal algorithm used to traverse a graph. Print the depth-first search traversal of the below graph. Start the traversal from node A. [Graph structure includes nodes A, B, C, D, E, F, G, H, I, J, K with various undirected edges.] [5 marks]
  19. Q5(c). Write a function in C to implement Kruskal's algorithm? Construct the minimum spanning tree for the given graph using Prim's Algorithm- [Graph with nodes 0 to 8 and weighted edges: (0,1) weight 4, (0,7) weight 8, (1,7) weight 11, (1,2) weight 8, (2,3) weight 7, (2,5) weight 4, (2,8) weight 2, (3,4) weight 9, (3,5) weight 14, (4,5) weight 10, (5,6) weight 2, (6,7) weight 1, (6,8) weight 6, (7,8)… [5 marks]