Monday, 19 March 2018

Representation of Algorithm

There were various ways to represent an algorithm:-
   1. As a program
   2. As flowchart
   3. As pseud codes

    A program is set of instruction that are arranged in a sequence that helps computer to solve complex problem.Moreover, the process of writing a program is called Programming.

  A flowchart is nothing but a graphical representation of an algorithm. 
    Flowchart is a representation, primarily through the use of symbols, of the sequence of activities in a system ( process , operation , function or activity ).
  Flowchart uses various graphical symbols. All symbols are connected among themselves to indicate the flow of information and processing.

Flowchart Symbols
  Flowchart symbols are used to represent an algorithm : 

       The oval represents any terminal point in a program and generally contains words such as START , END.

Input or Output:-
      The parallelogram represents the input (via keyboard) or Output ( to screen) function.

   The rectangle represents the processing operations. For example a = x + y.

Flow direction:-
   Line or arrow represents the flow direction function-the flow of control.It represents logical flow of program.

Decision Making:-
    The diamond represents a decision.It represents logical command such as IF-ELSE-ENDIF.

  The circle represents a function in a flow line

Pre-defined Process:-
   The double-sided rectangle represents a named process such as a module or function or subroutine.
           A flowchart uses boxes of different shapes to denote different types of instructions. The use of symbols having standardized meaning makes it easier to communicate program logic through flowchart.This is because as long as every use the same basic shape other can readily interpret the logic.

Advantage of Flowchart
  1. Better communication :- A flowchart is a pictorial representation of a program therefore it is easier for programmer to explain the logic of a program to some other programmer.
  2. Proper program documentation :- Program documentation involves collecting organizing, storing and otherwise maintaining a complete historical record of program.
  3.Efficient coding :- Programmers find if very easy to write the corresponding program because the flowchart acts as a road map for them.
  4. Systematic debugging :- A flowchart is very helpful in detecting locating and removing mistakes (bugs) in program in systematic manner.
  5. Systematic testing :- Flowchart proves to be very helpful in designing the test data for systematic testing of program.

Pseudo Code
   Pseudo code is program-planning tool used for planning program logic.
"Pseudo" means limitation or false and "code"  refers instruction written in programming language.
Pseudo code there for is a limitation of actual computer instruction.These pseudo instruction are phrase written in ordinary natural language.
   Pseudo code uses a structure that resembles computer instruction.


Post a Comment

Codecademy Code Foundations

Popular Posts


Android (23) AngularJS (1) Assembly Language (2) Books (10) C (75) C# (12) C++ (81) Course (1) Data Strucures (4) Downloads (1) Engineering (13) flutter (1) FPL (17) Hadoop (1) HTML&CSS (38) IS (25) Java (89) Leet Code (4) Pandas (1) PHP (20) Projects (17) Python (272) R (69) Selenium Webdriver (2) Software (14) SQL (27)