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

Program
    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.

Flowchart
  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 : 

  Terminal:-
       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.

Process:-
   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.

Connector:-
  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.

0 Comments:

Post a Comment

Popular Posts

Categories

100 Python Programs for Beginner (53) AI (34) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (173) C (77) C# (12) C++ (82) Course (67) Coursera (226) Cybersecurity (24) data management (11) Data Science (128) Data Strucures (8) Deep Learning (20) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (34) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (59) Meta (22) MICHIGAN (5) microsoft (4) Nvidia (3) Pandas (4) PHP (20) Projects (29) Python (932) Python Coding Challenge (358) Python Quiz (23) Python Tips (2) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (3) Software (17) SQL (42) UX Research (1) web application (8) Web development (2) web scraping (2)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses