Algorithms
Algorithms
Algorithms
Algorithms - Definition
An algorithm is a well-ordered sequence of unambiguous and effectively computable
instructions that when executed produces a result and halts in a finite amount of
time
Characteristics of Algorithms
a. Algorithms are well-ordered
b. Algorithms have unambiguous instructions
c. Algorithms have effectively computable instructions
d. Algorithms produce a result
e. Algorithms halt in a finite amount of time
Following are the most important design techniques to solve different types of the
problems:
1. Greedy algorithm
The solution is constructed through a sequence of steps, each expanding a
partially constructed solution obtained so far. At each step, the choice must be
flawless and ideal, and this flawlessness is achieved by selection criteria of
inputs.
2. Divide-and-conquer
The strategy of D and C (Divide and Conquer) technique to solve a problem is as
follows.
Given an instance of the problem to be solved, split this into several smaller
sub-instances (of the same problem), independently solve each of the sub-instances
by recursive applications of D and C and then combine the sub-instance solutions so
as to get a solution for the original instance
3. Dynamic programming
Algorithm Analysis
In computer science, the analysis of algorithms is the determination of the number
of resources (such as time and storage) necessary to execute them. A good number of
algorithms are designed to work with inputs of arbitrary length. Generally, the
running and efficiency time of an algorithm is confirmed as a function relating to
storage locations (space complexity) or the input length to the number of steps
(time complexity).