0% found this document useful (0 votes)
16 views

ADA Unit 2 Assignment

Uploaded by

jaeson.terence
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

ADA Unit 2 Assignment

Uploaded by

jaeson.terence
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BHAGWAN MAHAVIR UNIVERSITY

FACULTY OF ENGINEERING

Analysis & Design of


Algorithms - Theory
(2010206509)

ASSIGNMENTS
5TH SEMESTER

WINTER-2024
BHAGWAN MAHAVIR UNIVERSITY
FACULTY OF ENGINEERING
COMPUTER/IT ENGINEERING DEPARTMENT
5TH SEM
ASSIGNMENTS

Analysis & Design of Algorithms – Theory (2010206509)


Unit-2
Divide and Conquer Algorithm

Que 1: Answer the following Questions. (2 Marks)


1. How do divide and conquer approaches work? What do you mean by Divide &
Conquer approach? List advantages and disadvantages of it.
2. 2
What is asymptotic notation? Find out big-oh notation of the f(n) = 3𝑛 +5n+10
3. State whether the statements are correct or incorrect with reasons.
1. O(f(n)) + O(f(n)) = O (2f(n))
2 2
2. If 3n + 5 = O(𝑛 ) , then 3n + 5 = o(𝑛 )
4. An array A[1…n] is Bitonic if there exists a t such that A[1…t] is increasing and
A[t+1…n] is decreasing. Give an efficient algorithm to sort a Bitonic array A.
5. Multiply 981 by 1234 by divide and conquer method.

Que 2: Answer the following Questions. (4 Marks)


1. Solve the following using Master’s theorem:
a. T(n) = 2T(n/4) + 1
b. T(n)=3T(n/4) + nlgn
2. 2
Perform the analysis of a recurrence relation T(n)= 2T (n/2) + θ(𝑛 ) by drawing its
recurrence tree.
3. Explain how multiplication of large integers can be done efficiently by using divide
and conquer technique?
4. Trace given data using quick sort (3, 1, 4, 5, 9, 2, 6, 5).
5. Demonstrate Binary Search method to search Key = 14, form the array
A= <2,4,7,8,10,13,14,60>.

Que 3: Answer the following Questions. (6 Marks)


1. Analyze the algorithm to find the maximum and minimum element from an array.
Algorithm: Max ?Min Element (a [])
Max: a [i]
Min: a [i]
For i= 2 to n do
If a[i]> max then
max = a[i]
if a[i] < min then
min: a[i]
return (max, min)

Page 1 of 3
BHAGWAN MAHAVIR UNIVERSITY
FACULTY OF ENGINEERING
COMPUTER/IT ENGINEERING DEPARTMENT
5TH SEM
ASSIGNMENTS

2. Write a Merge sort algorithm and compute its worst case and best-case time
complexity. Sort the List G, U, J, A, R, A, T in alphabetical order using merge sort.
3. Illustrate the working of the quick sort on input instances: 25, 29, 30, 35, 42, 47, 50,
52, and 60. Comment on the nature of input i.e. best case, average case or worst
case.
4. Explain the use of Divide and Conquer Technique for Binary Search Method. What
is the complexity of the Binary Search Method? Explain it with an example.
5. Write pseudocode for Strassen’s algorithm. Use it to compute the matrix product

.
Bonus Problem:
Asymptotic behavior of functions

************

Page 2 of 3

You might also like