📖 Samacheer Kalvi · 11th TN - English Medium · Computer Science · Page 94example

Composition and Decomposition

Chapter 2: Chapter 2 · Computer Science

Composition and Decomposition In Chapter , we saw that algorithms are composed of statements. Statements can be grouped into compound statements, giving rise to a hierarchical structure of algorithms. Decomposition is one of the elementary problem-solving techniques.An algorithm may be broken into parts, expressing only high level details. Then, each part may be refined into smaller parts, expressing finer details, or each part may be abstracted as a function.

. Notations for Algorithms We need a notation to represent algorithms. There are mainly three different notations for representing algorithms. • A programming language is a notation for expressing algorithms to be executed by computers.

• Pseudo code is a notation similar to programming languages. Algorithms expressed in pseudo code are not intended to be executed by computers, but for communication among people. • Flowchart is a diagrammatic notation for representing algorithms. They give a visual intuition of the flow of control, when the algorithm is executed.

. . Programming language A programming language is a notation for expressing algorithms so that a computer can execute the algorithm. An algorithm expressed in a programming language is called a program.

C, C++ and Python are examples of programming languages. Programming language is formal. Programs must obey the grammar of the programming language exactly. Even punctuation symbols must be exact.

They do not allow the informal style of natural languages such as English or Tamil. There is a translator which translates the program into instructions executable by the computer. If our program has grammatical errors, this translator will not be able to do the translation. .

. Pseudo-code Pseudo code is a mix of programming- language-like constructs and plain English. This notation is not formal nor exact. It uses the same building blocks as programs, such as variables and control flow.

But, it allows the use of natural English for statements and conditions. An algorithm expressed as pseudo code is not for computers to execute directly, but for human readers to understand. Therefore, there is no need to follow the rules of the grammar of a

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →