Why Algorithms?
Modelling the Problem: Modeling is the art of formulating our application regarding precisely described, well-understood problems. Proper modelling is the key to applying algorithmic design techniques to real-world problems. Adequate modelling can eliminate the need to design or even implement algorithms, by relating our application to what has been done before.
Five Representative Problems
- Interval Scheduling
- Weighted Interval Scheduling
- Bipartite Matching
- Independent Set
- Competitive Facility Location
What are Algorithms?
An algorithm is more than a branch of computer science. It is the core of computer science, and, in all fairness, can be said to be relevant to most of science, business, and technology. The very nature of algorithm renders it particularly applicable to those disciplines that benefit from the use of computers, and these are fast becoming an overwhelming majority.
Logic + Control= Algorithm &, Data Structures + Algorithms= Program
An algorithm is a finite sequence of step by step, discrete, clear instructions for solving a particular problem, has input data, and is expected to produce output data, and each instruction can be carried out in a finite amount of time in a deterministic way.
Features of Algorithm:
(A) Input { One or, More}
(B) Output {Zero or, More}
(C) Finiteness { Termination}
(D) Definiteness { Precise definite each step}
(E)Effectiveness
The modern meaning of algorithm is quite similar to that of Recipe, Process, Methods, techniques, Procedure and Routine. An algorithm is a sequence of unambiguous instructions for solving problem, i.e. for obtaining a required output for any legitimate input in a finite amount of time.
A computer program is an implementation of one or more algorithms.
Good Algorithm: - Correctness, Time and Space Efficiency.
Better algorithm:-Lower bonds, Optimality.
Running time T(n): - It is an initial time for efficient execution of an algorithm.
Best case | Lower Bound: - The target is the first element of the array, Make one comparison.
Worst case | Upper Bound:-The target is not in the array or, the aim is at the last position in the collection. Make n comparison in either case.
Average case | Tight Bound:- (Best case+ worst case)/2 = (n+1)/2