Lecture-1-2: Faculty: Aditya Dayal Tyagi Department of Computer Science & Engineering
Lecture-1-2: Faculty: Aditya Dayal Tyagi Department of Computer Science & Engineering
Introduction to Algorithm
25 July 2019
Design and Analysis of Algorithms
Algorithm:
A finite set of well-defined instructions arranged in a
specific sequence to solve a computationally feasible
problem.
Characteristics of Algorithm-
1. Input-The range of input should be specified.
2. Output-Expected output should be specified.
3. Definiteness/ Effectiveness-Each instruction must
be clear and unambiguous.
4. Finiteness-Algorithm must terminate after a finite
number of steps.
5. Feasibility-It must be possible to perform each
instruction.
Design and Analysis of Algorithm
• Algorithmic is a branch of computer science
that consist of designing and analyzing
computer algorithm.
• 1. The Design refers to-
(i) The description of algorithm at an abstract
level by means of a pseudo language and-
(ii) Proof of correctness that is, the algorithm
solves the given problem in all cases.
2. The Analysis deals with the performance
evaluation(Complexity Analysis)
Algorithm Performance/Complexity of
Algorithm/Efficiency of Algorithm/
Analysis of Algorithm
• Two important ways to characterize the
efficiency of an algorithm are its Time
Complexity & Space Complexity.
• Time complexity
– How much no of steps is required to execute
an Algorithm
• Space complexity
– How much space is required to execute an
Algorithm
Time Complexity
• problem size: n
• basic algorithm / actual processing
• memory access speed
• CPU/processor speed
• # of processors?
• compiler/linker optimization?
Time Complexity