Algorithm Design and Analysis
SWE · Lab Midterm · Summer 26 · 1 view
shared by Md. Mehedi Hasan 251-35-322
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
Lab Assessment, Summer 2026
Course Code: SE215; Course Title: Algorithm Design & Analysis Lab
Sections & Teachers: 4412 (AF)
Time: 35 Minutes
Marks: 25
Question 1: Student Record Search System
A university maintains the student IDs of a laboratory section in random order. Since Binary Search only works on sorted data, you must first sort the IDs and then search for a specific student.
Input
• An integer N representing the number of student IDs.
• N integer student IDs.
• A student ID to search.
Tasks
1. Sort the student IDs in ascending order using Quick Sort.
2. Display the sorted array.
3. Search the given student ID using Binary Search.
4. Display the index (0-based) if found; otherwise print "Student ID Not Found".
Sample Input
8
3021 1056 4123 2089 3001 1125 4090 2005
3001
Sample Output
Sorted IDs:
1056 1125 2005 2089 3001 3021 4090 4123
Student ID found at index 4.
Question 2: Employee Salary Management
A company stores employee salaries in an array. The HR department wants to arrange the salaries and check whether a particular salary exists.
Input
• Number of employees N
• N salaries
• User choice
o 1 -> Ascending
o 2 -> Descending
• Salary to search
Tasks
1. If the user chooses
o 1, sort the salaries in ascending order using Insertion Sort.
o 2, sort the salaries in descending order using Insertion Sort.
2. Display the sorted salaries.
3. Search the target salary using Linear Search.
4. Print its position (1-based) if found; otherwise print "Salary Not Found".
Sample Input
7
42000 38000 50000 47000 35000 52000 40000
2
47000
Sample Output
Sorted Salaries:
52000 50000 47000 42000 40000 38000 35000
Salary found at position 3.