Presentation Transcript
Design and Analysis of Algorithms :3/7/2009 Presented by : Neil Peter B. Yu 1 Design and Analysis of Algorithms
Introduction :3/7/2009 Presented by : Neil Peter B. Yu 2 Introduction At the end of this presentation, the students should be able to understand what is algorithm and identify its purpose, the use of algorithms, and how they will apply the algorithms to programming.
What is Algorithm? :3/7/2009 Presented by : Neil Peter B. Yu 3 What is Algorithm? Algorithm is a set or series of instruction for carrying a particular task.
It is also a procedure to produce the required output from the given input.
It is similar with a paragraph that expresses a single thought.
Topics of Discussion :3/7/2009 Presented by : Neil Peter B. Yu 4 Topics of Discussion Purpose
Use of Algorithms
Application of Algorithms to programming
Purpose :3/7/2009 Presented by : Neil Peter B. Yu 5 Purpose To produce a consistent output based on a precise instruction.
e.g:
Creating a program.
Cooking.
Driving a car.
How it relates to your daily task.
Use of Algorithms :3/7/2009 Presented by : Neil Peter B. Yu 6 Use of Algorithms It can be used to follow a certain steps of instructions such as:
Doing a mathematical problem
Programming
Daily Task
Application of Algorithms to Programming :3/7/2009 Presented by : Neil Peter B. Yu 7 Application of Algorithms to Programming By means of flowchart
Is used to describe processing procedures based on detailed analysis.
Example of Flow Chart :3/7/2009 Presented by : Neil Peter B. Yu 8 Example of Flow Chart START P = 0 INPUT A,B,C P=A*B*C OUTPUT P STOP
Explanation of the flowchart :3/7/2009 Presented by : Neil Peter B. Yu 9 Explanation of the flowchart Flowchart shows how to determine the product of the three (3) numbers.
Sample Program :3/7/2009 Presented by : Neil Peter B. Yu 10 Sample Program #include
#include
main()
{
int A,B,C,P;
clrscr();
printf("Enter First Number: ");
scanf("%d",&A);
printf("Enter Second Number: ");
scanf("%d",&B);
printf("Enter third Number: ");
scanf("%d",&C);
P=A*B*C;
printf("The product of A*B*C is: %d",P);
getch();
}
Thank you for your time :3/7/2009 Presented by : Neil Peter B. Yu 11 Thank you for your time I hope you gained knowledge from what I presented.