Anda di halaman 1dari 3

Design Analysis and Algorithms

RAJALAKSHMI ENGINEERING COLLEGE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 2 MARKS Questions and Answers(University Questions also Included) Subject Name: Design Analysis and Algorithms Year/Sem: II/IV UNIT I 1. 2. 3. 4. 5. 6. 7. 8. 9. What are Sequential Algorithms? What are Parallel Algorithms? What is Exact and Approximation algorithm? What is Algorithm Design Technique? Nov/Dec 2005 Explain Algorithms Correctness What is Efficiency of algorithm? How to measure an algorithms running time? Prove that 10n2+5n+2 O (n2)? Define O notation? 10. Define notation 11. .Prove that n3 (n2)? 12. Define - notation 13. Prove that( )n(n-1) (n2) 14. What is the use of Asymptotic Notations? 15. What is the running time of a program implementing the algorithm? 16. Define Recurrence Equation. 17. Calculate the Space Complexity of the addition of n numbers Algorithm Previous Years University Exam Questions 18. What is an Algorithm? May/June 2006, Nov/Dec 2008,Apr/May 2007 An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time 19. Define Big oh notation May/June 2006, April/May 2008 A function t(n) is said to be in O(g(n)) denoted t(n) O (g(n)), if t(n) is bounded above by some constant multiple of g(n) for all large n, i.e., if there exist some positive constant c and some non negative integer n0 such that T (n) < c g (n) for n > n0 20. Define Order of an Algorithm.(Apr 2007)

Design Analysis and Algorithms The efficiency analysis framework concentrates on the order of growth of an algorithms basic operation count as the principal indicator of the algorithms efficiency. To compare and rank such orders of growth we use three notations 1) 2) 3) O (Big oh) notation (Big Omega) notation & (Big Theta) notation

21. Differentiate Time Complexity from Space complexity.(Apr 2010) Time Complexity Space Complexity Time Complexity of an algorithm is Space Complexity of an Algorithm is the the amount of computer time it amount of memory it needs to run to needs to run to completion completion The relationship between problem size and time complexity is linear. The relationship between problem size and space complexity is constant.

22. What is a Recurrence Equation?(Apr 2010) A recurrence relation is an equation that recursively defines a sequence, once one or more initial terms are given: each further term of the sequence is defined as a function of the preceding terms. 23. Enumerate some important types of problems(May 2008) Sorting Searching String Processing Graph Problems Combinatorial Problems Geometric Problems Numerical Problems 24. If f(n)=amnm+a1n+a0,then prove that f(n)=O(nm).(Nov 2010) Proof: f(n) i=0 to m|ai||ni nmi=0 to m|ai||ni-m nmi=0 to m|ai|,for n1

So, f(n)=O(nm)(assuming m is fixed) 25. Establish a relationship between O and .(Nov 2010) 2

Design Analysis and Algorithms

26. Using the step count method analyze the time complexity when 2 m n matrices are added.(Apr 2011) Statement 1. void add(type a[][SIZE], type a[][SIZE],)) 2.for(int i=1;i<=m;i++) 3. for(int j=1;i<=n;j++) 4. c[i][j]=s[i[][j]+b[i][j] 5. } Total S/e 0 1 1 1 0 Frequency Total m+1 m+1 m(n+1) mn+m mn mn 0 0 2mn+2m+1

27. An array has exactly n nodes. They are filled from the set {0, 1, 2,...,n-1, n}. There are no duplicates in the list. Design an O(n) worst case time algorithm to find which one of the elements from the above set is missing in the array.(Apr 2011) Linear Search Algorithm

Anda mungkin juga menyukai