Skip to content

Data Structure

SWE · Midterm · Fall 25

Paper 1 of 2By Md. Nahid Hasan DishanSwitch

Paper 1 of 2

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University Faculty of Science & Information Technology Department of Software Engineering Midterm Examination, Fall 2025 Course Code: SE 131, Course Title: Data Structure Level: 2 Term: 1 Section: A, B, C, D, E, F, G, H, I, J, K Instructor: AB (A, B), MAK (C, D), FA (E), DMA (F, G, H), FE (I, J, K) One and half hours (1:30 Hrs) Marks: 25 Directions: Answer questions serially. 1. A. Describe the disadvantages of an Array compared to a Linked List with examples. Explain how these dis-advantages affect the performance of the data structure operations? [CLO-1, Level-1] [Marks-2] B. Define recursion with example of a recursive function. [CLO-1, Level-1] [Marks-2] 2. Scenario 1: You are working as a digital archivist in an ancient secret library where each scroll is labeled with an alphabetic code that represents the order in which it was discovered. To prepare the archives for decryption, you must first sort the scrolls alphabetically, and later search for specific scrolls when decoding knowledge sequences. After cataloguing, the scroll codes you collected are: J, D, A, G, F, K, E, C, H, L, B, I Compute the complexity of Bubble Sort and complexity Binary Search to sort and search in this array. Show both complexity calculation steps and reasoning. [CLO-2, Level-2] [Marks-2+2] 3. Scenario 2: A group of students is working on a programming project to manage the scores of players in a mini gaming competition. Initially, the scores of the first few players are recorded in an array as follows: [42, 75, 23, 56, 89, 34]. To efficiently process the data, the students plan to perform the following operations: [CLO-3, Level-3] [Marks-6] A) To analyze performance rankings, sort the scores in ascending order using Bubble Sort. Illustrate the steps of the Bubble Sort algorithm as applied to this array. B) A new player joins the game with a score of 50. Insert this score into the sorted array at the correct position to maintain ascending order. Show the resulting array after insertion (Show the process only). C) One of the players wants to check if their score 56 exists in the list. Illustrate the basic code to perform a Binary Search for this score in the sorted array. 4. A. Suppose the available memory addresses for Linked list nodes are: "3000", "3025", "3050", "3075", "4000", "4025", "4050". Now, you need to store the following passenger names in a linked list in their arrival order: "Alice", "Brian", "Catherine", "David", "Evelyn", "Frank", "Grace". They are currently standing in a queue of airline check-in. Perform the following operations one by one: [CLO-3, Level-3] [Marks-8] a) Sketch the linked list. [2] b) Two passengers, "Alice" and "Brian", have completed check-in, Sketch the linked list. [2] c) Again sketch the linked list, after three new passengers, "Hannah", "Jim" and "Ian", arrived for check-in. [2] d) If you need to construct a node to store the above data, then write the down the basic part of the Code, to create the structure and allocate memory for the linked list? [2] B. A railway-ticketing counter uses a stack to keep track of the last booked tickets. Initially, the stack (capacity = 6) contains: T1, T2, T3. Perform the following operations and illustrate the state of the stack after each one: [CLO-3, Level-3] [Marks-3] a) Draw the initial stack (show the top pointer and array indexes). b) Push two new tickets: T4, T5. c) Pop one ticket. d) Push new tickets: N1, N2, N3 e) Pop one ticket and Push : M1, M2 f) Pop 6 tickets to empty the stack and show the final state.