1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Definition of Algorithm
>set of step-by-step instructions to accomplish a task.
>originally referred to any computation performed via a set ofrules applied to numbers written in decimal form.
>Word is derived from the phonetic pronunciation of the last name of
Abu Ja'far Mohammed ibn Musa al- Khowarizmi, who was an Arabic mathematician who invented a set of rules for performing the four basic arithmetic operations
>procedure is a finite sequence of well-defined instructions, each of which can be mechanically carried out in a finite amount of time
Steps in making good algorithm
>Inputs and outputs should be defined precisely.
>Each steps in algorithm should be clear andunambiguous.>Algorithm should be most effective among manydifferent ways to solve a problem.>An algorithm shouldn't have computer code. Instead,the algorithm should be written in such a way that,it can be used in similar programming languages.
Pseudocode
•is an artificial and informal language that helps develop algorithms.
•It is useful in developing algorithms that will be later converted into C language programming.
•It is similar to English statements and not executed on computers.
Pseudocode Constructs
These constructs — also called keywords — are used to describe the control flow of the algorithm.
SEQUENCE
sequentially performed one after the other
WHILE
is a loop with a condition at its beginning
REPEAT-UNTIL
is a loop with a condition at the bottom
FOR
is another way of looping.
-IF-THEN-ELSE
is a conditional statement changing the flow of the algorithm
CASE
is the generalization form of IF-THEN-ELSE
Flowchart
-is a tool developed in the computer industry, for showing the steps involved in a process.
-A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows - each shape represents a step in the process, and the arrows show the order in which they occur.
-A flowchart is a diagram that depicts the "flow" of a program
Terminator (Oval)
Meaning: Represents the start or end of a process.
Example: "Start" or "End
Process (Rectangle):
Meaning: Indicates a specific action or task within the process.
Example: "Calculate total" or "Process order"
Decision (Diamond):
Meaning: Represents a decision point that can lead to multiple outcomes (e.g., Yes/No).
Input/Output (Parallelogram):
Meaning: Represents data entering or leaving the system, such as user input or output results.
Arrow (Flow Line):
Meaning: Shows the direction of the process flow, connecting different symbols to indicate the sequence of steps.
symbols to indicate the sequence of steps.
onnector (Circle):
Meaning: Used to connect different sections of a flowchart, especially in complex diagrams.
Example: Indicates a continuation of the flow on another page or section