Skip to content

Data Structure

SWE · Midterm · Spring 26

Paper 1 of 3By S M KAIFSwitch

Paper 1 of 3

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, Spring 2026 Course Code: SE 131 Course Title: Data Structure Level: 1 Term: 3 Sections: 45 (A, B, C, D, E, F, G, H, I, J, K, L) Instructors: AB (A, B), DMA (C, D, E), MAK (F), HBM (G), SD (H, I), MAB (J, K), NML (L) Time: 1 hour 30 minutes Marks: 25 Directions: - Answer questions serially. 1. A. Describe linear data structures and non-linear data structures with one example of each. [CLO-1, Level-1] [Marks-2+1] 1. B. Define time complexity and space complexity, and briefly explain their importance in algorithm design. [Marks-2+2] 2. Scenario 1: A university system stores thousands of student records in a database. Administrators for academic and administrative purposes regularly access these records. [CLO-2, Level-2] [Marks-2+2] Case 01: To find a particular student ID, the system checks records starting from the first entry and continues one record at a time until the required ID is found or the list ends. Case 02: In another system, the student records are arranged in increasing order of ID, and the system repeatedly compares the target ID with the middle record and discards half of the remaining records after each comparison. A. Considering the above scenario, for each case, explain the appropriate searching technique and compute its time complexity. B. Show which searching technique is more efficient and why. 3. A. Scenario 2: A software system stores some character elements in an array in descending alphabetical order as shown below: ['Z', 'Y', 'X', 'V', 'U', 'T', 'S', 'R', 'Q', 'P', 'O', 'N', 'M', 'L', 'K', 'J', 'T', 'E', 'D', 'G', 'C'] [CLO-3, Level-3] [Marks-2+4] The system attempts to search for the character 'W' using binary search. Show the steps of Binary Search. 3. B. A group of students is managing player scores for a mini gaming competition. The scores of 7 players are initially stored in an array as follows: [58, 42, 91, 33, 76, 25, 64] i) Apply Bubble Sort to arrange the scores in ascending order (show only the required passes). ii) After sorting, delete the score 33 from the array (show the main part of the code only). 4. A. Suppose a network router maintains a singly linked list to track active data packets waiting for transmission. Assume each node occupies 24 bytes, and the available memory locations for nodes are: 2000, 2024, 2048, 2072, 2096, 2120, 2144 [CLO-3, Level-3] [Marks-8] The packet IDs arrive at the router in the following order: P101, P102, P103, P104, P105, P106, P107 Perform the following operations: a) Sketch the linked list after inserting all packets in arrival order. b) After transmission, the first two packets leave the buffer. Sketch the updated linked list. c) Later, three new packets P108, P109, and P110 arrive and are added in the last of the buffer. Sketch the linked list again. d) Write the basic code to define a node structure and insert a node at the end of a singly linked list. 4. B. A media player keeps track of the most recent audio tracks accessed by a user. The system always records the latest track on top, and when a track is removed, the most recently added track is removed first, i.e. works in LIFO format. The system size of this player is 4. Initially, the system contains the following tracks in memory: A1, A2, A3 [CLO-3, Level-3] [Marks-3] Draw the following operations step by step: a) Draw the initial arrangement, clearly indicating the most recent track and array index positions. b) Two new tracks A4 and A5 are accessed and added to the system. c) One track is removed from the system. d) Three more tracks B1, B2, and B3 are accessed and added. e) One track is removed, followed by adding two tracks C1 and C2. f) Nine tracks are removed consecutively. Draw the final state of the system.