Give some valid justifications for following: Incorrect Algorithm Why we need algorithm analysis? Write Difference between Program vs. Algorithm. Basic elements of an algorithm.
Give some valid justifications for following:
Incorrect
Why we need algorithm analysis?
Write Difference between
Basic elements of an algorithm.
Incorrect Algorithm :
Incorrect Algorithm, there are two condition in which we can say that algorithm is incorrect, first when algorithm has some error like LOGICAL Error which developer/programmer does, second when program executes properly but shows unexpected result of execution, it creates conflict between the client and developer, i.e algorithm executes properly without error but not shows proper result.
Why we need algorithm analysis?
It is an important part for computational complexity theory
It helps us to estimate required resources of algorithm to solve the requirement
Types of Analysis we do :
Worst Case
Best Case
Average Case
Above types will describe the time, how much time algorithm takes to execute as per the inputs provided by the users.
Step by step
Solved in 4 steps