ALGORITHM DESIGN STRATEGY :
There are several strategies are listed below :
1. Divide and Conquer.
2. Brute-force.
3. Backtracking.
4. Dynamic programming,
5. Branch and Bound.
Divide And Conquer Strategy :
Divide and conquer is a technique for designing algorithm that consist of decomposing the problem instance into a number of smaller sub instance of a same problem solving each of these sub instances independently and then combining the sub solution to obtain the solution of the original problem.
Divide and conquer involves three steps
1. Divide : divide the problem in to sub problem .
2. Conquer : Solve each sub problem .
3. combine : combine the sub problem solution to create the solution to be original problem.
ALOGORITHM ANALYSIS :
Every program consist of two important part :
PROGRAM = DATA STRUCTURE + ALGORITHM
There is a close relationship between data structure and algorithm. An algorithm is finite set of instruction that if followed accomplishes a particular task. It a method that can be used by a computer for the solution of a problem. The choice of a good algorithm effects the efficiency of the program.
Algorithm for calculate area of circle.
step1 :start
step 2:accept radius .
step 3: calculate area = pi *radius * radius .
step 4 : display area .
step 5:stop .
.
0 comments:
Post a Comment