×
In order to succeed, we must first believe that we can.
--Your friends at LectureNotes

# Note for Design And Analysis Of Algorithm - DAA by selvakanmani.cse s

• Design And Analysis Of Algorithm - DAA
• Note
• Anna University -
• 54 Views
• Uploaded 6 months ago
Selvakanmani.cse S
0 User(s)

### Leave your Comments

#### Text from page-1

UNIT 1 PART A 1. What is an algorithm? Or Define an algorithm. An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition, all algorithms must satisfy the following criteria: input Output Definiteness Finiteness Effectiveness. 2. Define Program. A program is the expression of an algorithm in a programming language. 3. What is performance measurement? Performance measurement is concerned with obtaining the space and the time requirements of a particular algorithm. 4. Write the For LOOP general format. The general form of a for Loop is For variable := value 1 to value 2 Step do { <statement1> <statement n > } 5. What is recursive algorithm? Recursive algorithm makes more than a single call to itself is known as recursive call. An algorithm that calls itself is Direct recursive. Algorithm A is said to be indeed recursive if it calls another algorithm, which in turn calls A. 6. What is space complexity? The space complexity of an algorithm is the amount of memory it needs to run to completion.

#### Text from page-2

7. What is time complexity? The time complexity of an algorithm is the amount of time it needs to run to completion. 8. Give the two major phases of performance evaluation Performance evaluation can be loosely divided into two major phases: a prior estimates (performance analysis) a posterior testing (performance measurement) 9. Define input size. The input size of any instance of a problem is defined to be the number of elements needed to describe that instance. 10. Define best-case step count. The best-case step count is the minimum number of steps that can be executed for the given parameters. 11. Define worst-case step count. The worst-case step count is the maximum number of steps that can be executed for the given parameters. 12. Define average step count. The average step count is the average number of steps executed an instances with the given parameters. 13. Define the asymptotic notation “Big oh” (0) A function t(n) is said to be in O(g(n)) (t(n) Є O(g(n))), if t(n) is bounded above by constant multiple of g(n) for all values of n, and if there exist a positive constant c and non negative integer n0 such that t(n) ≤ c*g(n) for all n ≥ n0.

#### Text from page-3

14. Define the asymptotic notation “Omega” ( Ω ). A function t(n) is said to be in Ω(g(n)) (t(n) Є Ω(g(n))), if t(n) is bounded below by constant multiple of g(n) for all values of n, and if there exist a positive constant c and non negative integer n0 such that t(n) ≥ c*g(n) for all n ≥ n0. 15. Define the asymptotic notation “theta” (Θ) A function t(n) is said to be in Θ(g(n)) (t(n) Є Θ(g(n))), if t(n) is bounded both above and below by constant multiple of g(n) for all values of n, and if there exist a positive constant c1 and c2 and non negative integer n0 such that C2*g(n) ≤ t(n) ≤ c1*g(n)for all n ≥ n0. 16. What is a Computer Algorithm? 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. 17. What are the features of an algorithm?

#### Text from page-4

More precisely, an algorithm is a method or process to solve a problem satisfying the following properties: o Finiteness - Terminates after a finite number of steps o Definiteness - Each step must be rigorously and unambiguously specified. o Input - Valid inputs must be clearly specified. o Output - Can be proved to produce the correct output given a valid input. o Effectiveness - Steps must be sufficiently simple and basic. 18. Show the notion of an algorithm. An algorithm is a sequence of unambiguous instructions for solving a problem in a finite amount of time. 19. What are different problem types? o Sorting o Searching o String Processing o Graph problems o Combinatorial Problems o Geometric problems o Numerical problems 20. What are different algorithm design techniques/strategies? o Brute force