You are on page 1of 2

Vishwakarma Government Engineering College, Chandkheda

Computer Engineering Department


Semester: V
Subject: 3150703 Analysis and Design of Algorithms
Assignment 1
Date: 05/09/2022
CO 1
1. Define algorithm. Discuss key characteristics of algorithms. Why analysis of algorithm
is required?
2. Explain Average, Best and worst case analysis of an algorithm. Arrange following
growth rates in increasing order.
O(n1/4), O(n1.5), O(n3 lg n), O(n1.02), Ω(n6), Ω(n!), O(√n), O(n6/2), Ω(2n )
3. What is asymptotic notation? Explain in detail. Find out big-oh notation of the f(n)=
3n2+5n+10
4. What is the smallest value of n such that an algorithm whose running time is 100n2 runs
faster than an algorithm whose running time is 2n on the same machine?
5. Write and analyze the algorithm for bubble sort. Sort the letters of word “GUJARAT”
in alphabetical order using the same.
6. Write and analyze an insertion sort algorithm to arrange n items into ascending order.
Sort the array A=<41, 31, 69, 16, 38, 62> using the same.
7. Write and analyze the selection sort algorithm to arrange n items into ascending order.
Sort the array A=<4, 10, 22, 2, 13, 15, 19, 2, 18> using the same.
8. Sort the following numbers using shell sort. 65, 85, 15, 55, 5, 20, 95, 87, 45, 75, 23, 28.
Also analyze it.
9. Write the algorithm for heap sort. Sort the following numbers using heap sort. 25, 55,
15, 35, 45. Also analyze it.
10. Suppose we sort an array of eight integers using heap sort, and we have just finished
some heapify (either min-heapify or max-heapify) operations. The array looks like this:
{16 14 15 10 12 27 28} How many heapify operations have been performed on the root
of the heap?
11. List out various linear sort methods. Explain any one of them giving algorithm and
suitable example.

CO-2

12. What is recurrence? Solve following recurrence relations using iterative method.
(i) T(n) = T(n - 1) + 1 with T(0) = 0 as initial condition
(ii) T(n) = 2T(n / 2) + n

Page 1 of 2
13. Solve following recurrence relation using substitution method and express your answer
using Big-oh (O) notation. T(n) = 2T(n/2) + n2
14. Solve following recurrence relation using suitable method and express your answer
using Big-oh (O) notation. T(n) = T(n/3) + T(2n/3) + Ө(n)
15. Write the Master theorem. Solve following recurrence using it.
(i) T(n)=9T(n/3) + n
(ii) T(n)=3T(n/4) + nlgn
(iii) T(n) = T(2n/3) + 1
(iv) T(n)=2T(n/2) + n log n
16. Write and analyze the quick sort algorithm to arrange n items into ascending order. Sort
the array A=<25, 29, 30, 35, 42, 47, 50, 52, 60> using the same.
17. Write and analyze the merge sort algorithm to arrange n items into ascending order.
Trace the merge sort for the array A=<2, 7, 3, 5, 1, 9, 4, 8>.
18. Write and analyze the Binary Search Algorithm. Demonstrate Binary Search method to
search Key = 14, form the array A=<2, 4, 7, 8, 10, 13, 14, 60>

LAST DATE OF SUBMISSION: 20/09/2022

Page 2 of 2

You might also like