Algorithm Design and Analysis
SWE · Midterm · Spring 26
Paper 1 of 3By Shafiur Rahman Shafim (242)Switch
Paper 1 of 3
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: SE214; Course Title: Algorithm Design and Analysis
Sections & Teachers: SA(A,B,C), IS(D,H), FE(E,F,G), MMSI(I,J),
SSI(K,L), AF(M,N), AG(O)
Time: 1 Hour 30 Mins
Marks: 25
Answer ALL Questions
[The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.]
1. a) Analyze the time complexity of given code by calculating the operations it will require.
for(i=1; i<=n; i=i*5){
printf ("Hello, How is going your exam");
}
[Marks-2]
CLO-1 Level-4
b) Analyze the time complexity of Quick Sort Algorithm in Worst and Best Case Scenario.
[Marks-3]
2. You are developing software for a library inventory system. The system receives the following book ID numbers according to your course code in random order: [532, 235, 217, 215, 214, 216]
To organize them, the system repeatedly performs these steps:
* It scans the entire list to find the smallest ID
* Moves that ID to the first unsorted position
* Repeats this process for the remaining unsorted IDs until the list is fully arranged
After arranging apply your best known search algorithm to find the Algorithm Theory course book ID.
Demonstrate the overall step-by-step process.
[Marks-8]
CLO-2 Level-2
b) An integer sequence [54, 95, 89, X, 27, 66, 38, 12] is provided, where the value of X is determined by the expression
X = - ((2P + 10) / 2 + P)
Here, P represents the last two digits of your student ID.
Determine a suitable divide-and-conquer based sorting strategy that rearranges the elements into ascending order, while ensuring that the algorithm does not use any additional memory.
Visualize the steps of the sorting process to clearly demonstrate how the algorithm transforms the array into a sorted sequence.
[Marks-7]
3. a) A teacher records the marks of nine students in the order they submitted their assignments:
* Student A: 34
* Student B: 12
* Student C: 45
* Student D: 20
* Student E: 8
* Student F: 30
* Student G: 25
* Student H: 40
* Student I: 15
The teacher chooses a sorting strategy that recursively splits the list into two halves, continues dividing until each sublist contains a single value, and then combines the sublists by repeatedly comparing the elements of each sublist. The goal is to arrange the marks so that higher marks appear before lower marks.
From the above scenario, construct the initial array in the given order. Based on your observation, identify the most suitable sorting algorithm for this problem, then break down and trace each recursive division step using a clear diagram, and illustrate how the sublists are combined.
Finally, compare the worst-case efficiency of the chosen algorithm with other possible algorithms.
[Marks-5]
CLO-3 Level-4