DAA Assignment 1
DAA Assignment 1
Gharuan, Mohali
Institute/Department: CSE
Division:BE
Subject Name: Design and Analysis of Algorithms
Subject Code: CST-302
Assignment No.: 1
Max. Marks: 12
Course Outcomes:
CO Title Level
Number
For(i=0;i<n;i++)
For(j=1;j<n;j++)
Count++ ;
Assignment :2
2 Q2:- The worst case time complexity of quick sort is O(n2). Why so? Explain CO1
mathematically.
3 Q3:- Write algorithm for implementation of stacks using linked list. CO3
12,56,88,11,2,12,96,32,,44,49,53,12,15
Assignment :3
Sr. Question CO
No. Number
23 5 4 1 2 3 4
42 1 3 2 4 2 4
61 2 5 1 1 1 2
85 1 2 3 2 1 2
2 Q2:- Give the algorithm for matrix multiplication and find the time CO1
complexity of the algorithm using step – count method.
3 CO1
Q3:- Differentiate between Big O and omega notation with example.
4 Q4:- Write Divide – And – Conquer recursive Merge sort algorithm and CO3
derive the time complexity of this algorithm.
Assignment :4
Sr. Question CO
No. Number
Q1:- Give the algorithm for Quick Sort and check whether it’s a stable CO4
sort or not.
Q2:- Give the plan for analyzing the time efficiency of non-recursive CO2
algorithms.
Q3:- What is a linear search algorithm? Analyze it in terms of time and space CO3
complexity.
search algorithm.
Sr. Question CO
No. Number
1 Q1:- What are the characteristics of an algorithm? Explain about Branch CO1
and Bound method.
2 Q2:- In terms of the big-O notation, compare the difference in time CO1
required for table lookup and for list searching.
3 Q3:- Differentiate between tree & graph. CO3
Assignment :6
Sr. Question CO
No. Number
1 Q1:- Define Stack and Queue. What are the operations that can be done on a CO2
stack?
2 Q2:- State the Euclid’s algorithm for finding GCD of two given numbers. CO2
3 Q3:- What are the 3 parts of the algorithm? Why do we need algorithm CO1
analysis?
4 Q4:- What do you mean by “Amortized efficiency”? How to measure the CO1
algorithm’s efficiency?
Assignment :7
Sr. Question CO
No. Number
2 Q2:- Find the number of comparisons made by the sequential search in the CO2
worst case and best case.
3 CO2
Q3:- Define control abstraction. Write the Control abstraction for Divide-
and conquer.
4 Q4:- Discuss Sum of subset problem. CO2
Assignment :8
Sr. Question CO
No. Number
Assignment :9
Sr. Question CO
No. Number
1 Q1.Perform insertion and deletion in binary tree using level order CO2
traversal and do the complexity analysis for the same.
2 CO3
Q2. Write a short note about AVL trees?
Assignment :10
Sr. Question CO
No. Number
38,43,720,5437,56,52
Assignment :11
Sr. Question CO
No. Number
Assignment :12
Sr. Question CO
No. Number
2 Q2. Write an algorithm to find maximum element from right sub tree and CO3
minimum element from left sub tree from BST?
3 CO2
Q3. What do you understand by the term pseudo code?