Introduction of Analysis Design & Algorithm
Introduction of Analysis Design & Algorithm
What is Algorithm?
Algorithm
1.is any well-defined computational procedure that takes some
value, or set of values, as input and produces some value, or set of
values, as output.
2.is thus a sequence of computational steps that transform the
input into the output.
3.is a tool for solving a well - specified computational problem.
4.Any special method of solving a certain kind of problem (Webster
Dictionary)
What is a program?
A program is the expression of an algorithm in a
programming language
a set of instructions which the computer will follow to
solve a problem
2.
Greedy method
3.
Dynamic Programming
4.
Backtracking
5.
6.
Parallel Algorithm
7.
Some Application
Study problems these techniques can be applied to
Sorting
Data retrieval
Network routing
Games
Etc
performance, modify)
improve them. (Research)
Complexity
The complexity of an algorithm is simply the amount of
work the algorithm performs to complete its task.
3.
Binary Search
Merge Sort
Quick Sort
Knapsack Problem
3. Dynamic Programming
Dynamic programming solves optimization problems by
combining solutions to sub problems
The key is to store the solutions of sub problems to be
reused in the future
Fig:- Finding the shortest path in a graph using optimal substructure; a straight line
indicates a single edge; a wavy line indicates a shortest path between the two
vertices it connects (other nodes on these paths are not shown); the bold line is the
overall shortest path from start to goal.
Reliability Design
Cost of a System <=105 3
D1
D2
D3
Cost
30
15
20
Reliabilit
y
0.9
0.8
0.5
Devices
4. Backtracking
Backtracking is the procedure whereby, after determining that a
node can lead to nothing but dead nodes, we go back (backtrack)
to the nodes parent and proceed with the search on the next child.
?
start
dead end
dead end
dead end
dead end
dead end
?
success!
8 Queens Problem
Hamiltonian Cycle
6. Parallel Algorithm
Parallel computing is a technique in which given problem is
2-3 Trees
B Trees