Data Structure
SWE · Midterm · Summer 25
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Department of Software Engineering
Faculty of Science & Information Technology
Midterm Exam Examination, Summer 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, L, M, N, O, P
Instructor: AB(A), DMA(B,C,D), RJM(E,F), MHS(G), MBH(H,I), MRD(J,K,O), SAN(L), AAS(M,N), AF(P) Modality: Physical
One and half hours (1:30 Hrs) Marks: 25
Directions:
- Students need to go through the CASE STUDY shown in this exam paper.
- Analyze and answer specific section based on your own thinking and work. Answer questions serially.
1. A. Describe why is it important to organize data using data structures? Write one example each of a linear and a non-linear data structure. [CLO-1, Level-1] [Marks-2]
B. Describe what is time complexity in algorithms, and also describe why is it important when comparing two solutions to the same problem? [CLO-1, Level-1] [Marks-2]
2. Scenario 1: You are participating in an intergalactic space mission where each completed mission grants you encrypted coordinates required to unlock the next galaxy sector. After successfully completing a mission, you have collected the following 12 encrypted coordinates:
57, 23, 89, 12, 46, 78, 35, 64, 91, 18, 53, 80
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. Use the same scenario "Scenario 1" and data given in Question 2 for this question. These 12 coordinates are stored in an unsorted array. To unlock the next galaxy, you need to verify whether the coordinate '64' exists in your collection. [CLO-3, Level-3, Marks-2+2+2=6]
A) If you need to sort by applying Bubble Sort to arrange the coordinates in Descending order, then Build the basic part of the code to perform this sorting operation.
B) To find out the coordinate "64", by using Binary Search, Apply the steps of binary search to find out it.
C) If the required coordinate 64 is found, Build the basic part of the code to delete that coordinate from the array.
4. A. You are given a set of available memory addresses: "4001", "4010", "4030", "4050", "4070", "4080". You are tasked with storing the following country names into a singly linked list: "Bangladesh", "Yeomen", "Canada", "USA", "Germany". Illustrate the following operation: [CLO-3, Level-3] [Marks-2*4=8]
a) Sketch the linked list.
b) Sketch the linked list, after deleting "USA".
c) After deletion sketch the linked list, after inserting the "Pakistan", "Palestine" as 2nd and 4th elements.
d) After the answer of question number (c), insert "Israel"?
B. Scenario 2: In a theater ticket booking system, users' booking requests are handled using a stack. Each time a user books a ticket, their booking ID is pushed onto a stack. The system allows the following operations:
push(),pop(),peek(),display().
The following code simulates how bookings are managed:
int main() {
push(10); push(20); push(30); display(); pop(); peek(); pop(); pop(); display(); return 0;
}
Now, what happens internally when you call push(10), to explain it build the code to implement the push function only. [CLO-3, Level-3] [Marks-3]