This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e planned before they are written.
2. The term algorithm refers to the logic of a program. It is a step-by-step description
of how to arrive at a solution of the given problem.
3. The primary factors that are often used to judge the quality of an algorithm are the
time needed to execute it, the memory space required to execute it, the accuracy of the results produced by it, and its capability to handle a range of input data instead of a single
input data (often referred to as generality property).
When an algorithm is represented in the form of a programming language, it
becomes a program. Thus any program is an algorithm although the reverse is not true.
Besides represented as programs, algorithms are often represented as flowcharts,
pseudocodes and decision tables.
A flowchart is a pictorial representation of an algorithm. It is often used by
programmers as a program planning tool for organizing a sequence of steps necessary to
solve a problem by a computer.
Decision tables are used to define clearly and concisely the word statement of a
problem in a tabular form. They can prove to be a powerful tool for defining complex
8. Pseudocode is a programming analysis tool that allows programmers to plan program
logic by writing the program instructions in an ordinary natural language such as English.
Structured Programming is a more scientific approach to solving a programming
problem by using only the three basic logic (control) structures namely, sequence logic,
selection logic an iteration (or looping) logic.
10. Structured programming helps in producing programs that are easy to understand and
maintain. It also helps in reducing program errors and the time spent in program testing.
11. Sequence logic is used for performing instructions one after another in sequence.
12. Selection logic is used for selecting the proper path out of the two or more alternative
paths in the progran logic. It uses three control structures called IF.. .THEN, IF.. .THEN..
.ELSE and CASE.
13. Iteration (or looping) logi...
View Full Document
- Spring '14