Skip to content

Algorithms

CSE · Midterm · Spring 26

Batch 68

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 Computer Science & Engineering Midterm Examination, Spring 2026 Course Code: CSE 213, Course Title: Algorithms Level: 2 Term: 1 Batch: 68 Time: 01:30 Hrs 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) Explain what an algorithm is. Discuss the characteristics of a good algorithm using the RAM model as a reference. | 02 | CO1 1. b) Define asymptotic notations: Big-O, Big-Ω, and Big-Θ. Explain their significance in complexity analysis. | 03 | 2. a) Analyze the time and space complexity of Binary Search. Explain why it performs better than Linear Search. | 02 | CO2 2. b) Analyze the time complexity of the following code snippet and express it using asymptotic notation: | 1.5*2 = 03 #include <stdio.h> | #include <stdio.h> int main () { | int main () { int n; scanf ("%d", &n); | int n; scanf ("%d", &n); int i = 1; | for (int i = 1; i < n; i++) { while (i < n) { | for (int j = 1; j < i; j+=2) int j = 1; | printf("Got it\n"); while (j < i) { | } j = j * 2; | } return 0; } } i = i * 2; } return 0; } 3. a) Design a recursive algorithm for computing GCD using Euclid's algorithm and write pseudocode, also analyze its complexity. | 05 | CO3 3. b) Given coin denominations {1, 5, 10, 25}, design a Greedy algorithm to make change for an amount 117. Explain why the greedy strategy works. | 05 | 3. c) Construct a Huffman Tree for the following frequencies: A:5, B:9, C:12, D:13, E:16, F:45 | 05 Show all steps to send the message "BADCAFE" using the Huffman Tree and compute total cost.