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

Assignment On Divide and Conquer

assignment

Uploaded by

Isha Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Assignment On Divide and Conquer

assignment

Uploaded by

Isha Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Government Engineering College, Rajkot

Computer Engineering Department


Subject: Analysis and Design of Algorithms
Subject Code: 3150703
B.E. Semester: 5th

Assignment – Divide and Conquer


1. Find order of growth using Master Method
(a) T (n) = 9T(n/3) + n (g) T(n) = T(9n/10) + n
(b) T(n) = 2T(n/4) + 1 (h) T(n) = 7T(n/2) + n2
(c) T (n) = 4T(n/2) + n2 (i) T(n) = 3T(n/3) + n
0.51
(d) T(n) = 2T(n/4) + n (j) T(n) = 3T(n/3) + √n
3
(e) T(n) = 2T(n/2) + n (k) T(n) = 3T(n/3) + n/2
2. Solve following recurrence equations using substitution method.
(a) T(n) = T(n-1) + n , T(1) = 1
(b) T(n) = 2T(√ ) + lgn , T(1) = 1
3. Solve following recurrence equations using iteration method.
(a) T(n) = T(n-1) + 2, T(0) = 1
(b) T(n) = 2T(n/2) + 2, T(2) = 1
4. Illustrate operation of Binary Search on following array
A = { 3 , 6, 9, 12, 33, 57, 66, 90 } and key = 90
A = { 3 , 6, 9, 12, 33, 57, 66, 90 } and key = 2
5. Sort following arrays using Merge Sort
(a) A = {54, 41, 35, 87, 11, 20, 32, 67}
(b) A = {0, 1, 5, 6, 8, 7, 9, 3, 2, 4}
(c) A = {S,O,R,T,I,N,G}
6. Sort following arrays using Quick Sort (Pivot is last element of array)
(a) A= {51,36,19,92,80,22,47,74}
(b) A = {3, 1, 2, 6, 8, 4, 9, 7}
(c) A = {E,X,A,M,P,L,E}
7. Perform matrix multiplication using Strassen’s algorithm
15 16 21 17
A = 11 13 B= 12 10
8. Multiply using divide and conquer method of multiplying two large integers :
(a) A = 12 and B = 53 (b) A = 52 and B = 210
9. Solve following Max-Min Problem using divide and conquer method:
A = {22, 15, -5, -18, 15, 60, 17, 31, -47}
A = {15, 26, 94, -2, -4, 9 , -22, 78, 99}
10. Find exponentiation using divide and conquer method:
(a) 29 (b) 311
11. Design recursive algorithm to convert decimal number into binary. Also derive
recurrence equation and find time complexity for this algorithm.

You might also like