Chapter 2 Flashcards
Algorithm
Algorithm
An EFFECTIVE procedure for solving a problem
in a FINITE number of steps.
OR
A finite list of instructions on how to perform a task
Properties of Algorithm
– The actions to be executed
– It must result in a finite series of actions.
– The order in which these actions are to be executed.
– The sequence terminates with a solution
Algorithm can be represented by
Flowchart,
Pseudocode,
Decision Table,
N-S Diagram
Flowchart
A GRAPHICAL REPRESENTATION of FINITE series of ACTIONS
OR
A graphical representation of an algorithm
or of a portion of an algorithm.
Basic Structures
Basic unit of programming language
Sequence (In order)
- Perform actions in order
* No branching or skipping any task
Selection (decision)
- Ask a question, take one of two actions
* Dual-alternative or single-alternative
Loop (Repetition)
• Repeat actions based on answer to a question
Pseudocode
An artificial and informal language that helps programmers to develop algorithm.
OR
A convenient informal language yet user friendly that helps programmers to develop algorithm.
Decision Tables
A precise yet compact way to model complicated logic.
N-S Diagram
A diagrammatic approach to algorithm design
Desk Checking
Process of testing can be done by execute the steps in
algorithm
Selection structures
– Single selection
– Two selections
– Multi selections