Computer Concept & Programming In C - Unit I - 8

Q.15 What is top-down development of a program.
Ans. The top down development of a program is shown in the following figure



Q.16  How are algorithms classified?
Related Questions -
Q. What are the various approaches to problem  solving ? Discuss any one of these.                                                                                                                                         (AKTU. 2013-14)
Ans. The figure is showing classification of algorithms.
Brief specification of algorithm: -
Input specialized algorithm (sequence, graph, set ….etc): -
This concept is of narrowing the algorithm concept by restrictions on the form of input. Eg. Polynomial algorithm, Matrix algorithm.
Strategy specialized algorithm: -
This concept is of narrowing algorithm in terms of strategies used in structuring the steps of algorithm.
e.g. divide and conquer algorithm, dynamic programming, greedy algorithm, Iterative algorithms.
Divide and conquer algorithm: -
(a) Divide the big problem into small problems until a storage is reached when small problems are solved directly.
(b) Solve small problems.  
(c) Combine the solutions of small problems to form a solution to big problem.
Dynamic programming: -
In dynamic programming approach
(a) Big problem is broken into small problems.
(b) Set of overlapping problems is found.
(c) Small problems are solved and result/solution stored.
(d) Result / solution of small problems is combined to solve big problem and from its solution.


Greedy Algorithm: -
It continuously looks for the best possible solution at every instant of programming.
Iterative algorithm: -
Performs a set of instructions for a specified and finite number of times until the problem is solved.

Q.17 What is programming ? How high level programming language is used for the systematic development of the programs ?
Ans. The word programming means to provide a sequence of instructions to a machine so that by following these instructions the machine can accomplish some task.
While giving instructions (programming) two points should be kept in mind.
(i) Every instruction that is given to the machine must be understood by machine. That is, all instructions must belong to programming language domain of the programming language chosen.
Example : printf( ), scanf( ) belong to domain of programming language C hence they are valid instructions for any C program.
(ii) Format / Syntax in which an instruction is given must be correct.
Example : printf(“a”); is correct syntax but; printf(“a”) or printf; (“a”) are INCORRECT.
Use of High Level Language For the Systematic Development of Programs: -
A High Level Language is a language which is relatively more close to natural language such as english so it is easier to write large programs in a high level language as compared to medium level language / assembly language and machine language / low level language.
There is one requirement for programming in High Level Language. A high level language requires its own language translator (generally a compiler or interpreter) in all cases. Language Translator (compiler / interpreter / assembler) converts a program written in high level language or medium level language into an eqvivalent program in machine language / low level language.
High Level Language are of two types :
1. General Purpose High Level Language: -
High Level Language that can be used to solve any programming related problem is known as a general purpose programming language. C, C++ are example of general purpose programming languages.
(2) Special Purpose High Level Language: -
High Level Language that can be used to solve a programming related problem of a specific problem domain are known as special purpose programming language. HTML, SQL, pHp etc are examples of special purpose programming languages.
Following list gives the specific problem domain and the high level language that is used for systematic development of programs of that domain.