Winter 20
Winter 20
Winter 20
___________
MARKS
Q.1 (a) What is an algorithm? Why analysis of algorithm is required? 03
(b) What is asymptotic notation? Find out big-oh notation of the f(n)= 04
3n2+5n+10
(c) Write an algorithm for insertion sort. Analyze insertion sort algorithm 07
for best case and worst case.
Q.2 (a) What is the difference between selection sort and bubble sort? 03
(b) Write iterative and recursive algorithm for finding the factorial of N. 04
Derive the time complexity of both algorithms.
(c) Solve following recurrence relation using iterative method 07
T(n)=2T(n / 2) + n
Q.3 (a) How divide and conquer approach work? 03
(b) Trace the quick sort for data A = {6,5,3,11,10,4,7,9} 04
(c) Explain master theorem and solve the recurrence T(n)=9T(n/3)+n with 07
master method
Fig-1
Q.5 (a) How huffman code is memory efficient compare to fixed length code? 03
(b) Give difference between greedy approach and dynamic programming. 04
(c) Find the Huffman code for each symbol in following text 07
ABCCDEBABFFBACBEBDFAAAABCDEEDCCBFEBFCAE
Q.7 (a) What is finite automata? How it can be used in string matching? 03
(b) Differentiate BFS and DFS 04
(c) Explain Backtracking Method. What is N-Queens Problem? Give 07
solution of 4-Queens Problem using Backtracking Method.
*************