0% found this document useful (0 votes)
22 views2 pages

Design and Analysis Cat

The document outlines a series of tasks related to the design and analysis of algorithms, including deriving time complexity using the Master Theorem, analyzing sorting algorithms, and explaining Big-O notation. It also compares binary and linear search methods, describes the Max Heap insertion process, and demonstrates Dijkstra's algorithm for finding the shortest path in a graph. Each task is assigned a specific mark value, indicating its importance in the overall assessment.

Uploaded by

philomenakathomi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Design and Analysis Cat

The document outlines a series of tasks related to the design and analysis of algorithms, including deriving time complexity using the Master Theorem, analyzing sorting algorithms, and explaining Big-O notation. It also compares binary and linear search methods, describes the Max Heap insertion process, and demonstrates Dijkstra's algorithm for finding the shortest path in a graph. Each task is assigned a specific mark value, indicating its importance in the overall assessment.

Uploaded by

philomenakathomi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SCHOOL OF COMPUTING AND INFORMATICS

DEPARTMENT OF INFORMATION TECHNOLOGY

CAT

UNIT CODE: BIT 3209 UNIT TITLE: DESIGN AND ANALYSIS OF ALGORITHMS

a) Given the following recurrence relation: T(n) = 2T(n/2) + O(n), derive its time
complexity using the Master Theorem. (5 marks)
b) Given the following algorithm for sorting an array, determine its time complexity and
justify your answer: (5 marks)

for(i = 0; i < n; i++)


{
for(j = i + 1; j < n; j++) {
if(arr[i] > arr[j]) {
swap(arr[i], arr[j]);
}
}
}

c) Describe the process of analyzing the time complexity of an algorithm using the Big-O
notation. Provide an example algorithm and walk through how to calculate its time
complexity. (5 marks)
d) Explain the difference between "Binary Search" and "Linear Search". Compare their time
complexities and discuss in which scenarios each would be preferred. (5 marks)
e) Given the following array: [5, 12, 20, 8, 35, 15], apply the Max Heap insertion algorithm
to construct the max heap. (5 marks)
f) Using the graph below, demonstrate how Dijkstra's algorithm is used to find the shortest
path from a given source node to all other nodes.
Graph:
A --(2)-- B --(1)-- C
| | |
(3) (4) (6)
| | |
D --(5)-- E --(7)--—F (5 marks)

You might also like