Introduction to Algorithm as Technology:
Algorithm: An algorithm is defined as a finite set of instructions that if followed, accomplishes a particular task.
Different phases of the Study of Algorithms:
- Designing algorithms: (How to devise algorithms?)
- Various design techniques are available to design algorithms. They include:
- Divide and Conquer
- Greedy Method
- Dynamic Programming
- Backtracking
- Branch and Bound
- Based on the type of problem, proper design technique is to be selected
- Various design techniques are available to design algorithms. They include:
- Algorithm Validation: (How to validate algorithms?)
- Once an algorithm is devised, it is necessary to show that it computes the correct answer for all possible legal inputs
- The purpose of the validation is to assure that this algorithm will work correctly independent of the issues concerning the programming language to be used
- After validation only a program can be written
- Analysis of algorithms: (How to analyze algorithms?)
- It refers to the task of determining the computing time (Time Complexity) and storage space required (Space Complexity) to execute an algorithm on a computer.
- It allows you to compare various algorithms used to solve a particular problem (iii)Performance of an algorithm in the best case, average case or the worst case will be measured
4.Testing programs: (How to test a program?)
(i)Debugging the program is done in this phase
(ii)It is the process of executing a program on sample data sets to determine whether errors occur and correcting them, if any.
Different criteria that satisfy an algorithm:
An algorithm must satisfy the following criteria:
- Input: zero or more quantities are externally supplied.
- Output: At least one quantity is produced.
- Definiteness: each instruction is clear and unambiguous. Example: add 6 or 7 to x (not permitted)
- Finiteness: if we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after a finite no.of steps
- Effectiveness: every instruction must also be feasible.
Example: performing arithmetic with real numbers is not much feasible due to long decimal expansions.