ALGORITHMS
An Algorithm is a sequence of finite instructions or steps used to complete a task or a problem. There is no generally accepted rule for algorithms, its a sequence of steps carried out to complete a task. But if we are considering computer programs, we need somewhat a standardized format for Algorithms, that means Algorithms are an aid for programs, so there should be a definite start and an end for the algorithm.
Algorithms can be expressed in different notations, including natural languages, Pseudo codes, flow charts etc. Flow Charts and Pseudo Codes are widely used for Technical and Complex algorithms. and are used in the structured program designs. Natural language expressions cannot be used as its may make ambiguity.
Algorithms can be expressed in different notations, including natural languages, Pseudo codes, flow charts etc. Flow Charts and Pseudo Codes are widely used for Technical and Complex algorithms. and are used in the structured program designs. Natural language expressions cannot be used as its may make ambiguity.
FLOWCHARTS
A Flowchart is a pictorial representation of an Algorithm or a Process, showing each steps in various kinds of boxes in order, and connecting these boxes with arrows.
Flowchart is the representation of the programming steps. It shows the various steps in sequence which are needed to run the program. Flowchart uses boxes of different shapes to denote different types of instructions. The instructions are written within these boxes using clear and concise statements. These boxes are connected by solid lines having arrow marks to indicate the flow of operations that is the exact sequence in which the instructions are to be executed. Flowchart helps in detecting errors in the program logic also. Once the flowchart is ready, the programmer can concentrate only on coding the operations in each box of the flowchart in terms of the statements of the programming language. This usually ensure an error-free program.
Flow Chart Symbols

Symbols
A typical flowchart from older Computer Science textbooks may have the following kinds of symbols:

Finding Largest among three input numbers
- Start and end symbols
- Represented as lozenges, ovals or rounded rectangles, usually containing the word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit enquiry" or "receive product".
- Arrows
- Showing what's called "flow of control" in computer science. An arrow coming from one symbol and ending at another symbol represents that control passes to the symbol the arrow points to.
- Processing steps
- Represented as rectangles. Examples: "Add 1 to X"; "replace identified part"; "save changes" or similar.
- Input/Output
- Represented as a parallelogram. Examples: Get X from the user; display X.
- Conditional or decision
- Represented as a diamond (rhombus). These typically contain a Yes/No question or True/False test. This symbol is unique in that it has two arrows coming out of it, usually from the bottom point and right point, one corresponding to Yes or True, and one corresponding to No or False. The arrows should always be labeled. More than two arrows can be used, but this is normally a clear indicator that a complex decision is being taken, in which case it may need to be broken-down further, or replaced with the "pre-defined process" symbol.
- Connectors
- There are instances when a flowchart becomes too large to fit in a single page and the use of flow lines becomes impossible. In such situations awe use the connector symbols as as substitute for flow lines.

Finding Largest among three input numbers
ADVANTAGES OF FLOWCHART
1. Conveys better meaning : Since a flowchart is a pictorial representation of a program, it is easier for a programmer to understand and explain the logic of the program to some other programmer.
2. Effective joining of a part of a system : A group of programmers are normally associated with the design of large software system. Each programmer is responsible for designing only a part of the entire system. If each programmers draws a flowchart for his part of design, the flowcharts of all the programmers can be placed together to visualize the overall system design.
3. Efficient Coding : Once a flowchart is ready, programmers find it very easy to write the concerned 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 in a program in a systematic manner.
5. Systematic Testing : Testing is the process of confirming whether a program will successfully do all the jobs for which it has been designed under the specified constraints. For testing a program different sets of data are fed as input to that program to test the different parts in the program logic.
Instead of using symbols to describe the logic steps of a program as in a flow charting, pseudo code uses a structure that resembles computer instructions. Because it emphasizes the design of the program. Pseudo code is also called Program Design Language [ PDL]. Pseudo code is made up of the following basic logic structures.
a. Pick out a desirable book
b. Take the book to the checkout counter
c. Pay for the book
d. Obtain receipt
e. Leave the store
Selection logic also known as decision logic, is used for making decisions. It is used for selecting the proper path out of the two or more alternative paths in the program logic. Selection logic is depicted as either an if.. then... else or if... then structure.
Iteration logic is used when one or more instructions may be executed several times depending on some conditions. It used two structures called the Do while and repeat until. Both these structures are used for looping.
2. Effective joining of a part of a system : A group of programmers are normally associated with the design of large software system. Each programmer is responsible for designing only a part of the entire system. If each programmers draws a flowchart for his part of design, the flowcharts of all the programmers can be placed together to visualize the overall system design.
3. Efficient Coding : Once a flowchart is ready, programmers find it very easy to write the concerned 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 in a program in a systematic manner.
5. Systematic Testing : Testing is the process of confirming whether a program will successfully do all the jobs for which it has been designed under the specified constraints. For testing a program different sets of data are fed as input to that program to test the different parts in the program logic.
DRAWBACKS OF FLOWCHARTS
- Flowcharts are something new and strange to work with for beginners.
- When modifications are made in the original program corresponding changes must be made in the flowcharts of the program in the documentation.
- Flowcharts may not reveal significant steps to be followed in actual coding.
- Flowcharts are often cumbersome to use and costly to produce.
- Flowchart don't constitutes a programming language. They are person to person means of communication, not person to computer.
PSEUDO CODE [STRUCTURED ENGLISH]
PSEUDO CODE is another program analysis tool that is used for planning program logic 'pseudo' means imitation and code refers to the instructions written in a programming language. Pseudo code is therefore an imitation of actual computer instructions. These pseudo instructions are phrases written in ordinary natural language.Instead of using symbols to describe the logic steps of a program as in a flow charting, pseudo code uses a structure that resembles computer instructions. Because it emphasizes the design of the program. Pseudo code is also called Program Design Language [ PDL]. Pseudo code is made up of the following basic logic structures.
- Sequence
- Selection [if....then....else, if...then]
- Iteration [ do...while,Repeat...until]
a. Pick out a desirable book
b. Take the book to the checkout counter
c. Pay for the book
d. Obtain receipt
e. Leave the store
Selection logic also known as decision logic, is used for making decisions. It is used for selecting the proper path out of the two or more alternative paths in the program logic. Selection logic is depicted as either an if.. then... else or if... then structure.
Iteration logic is used when one or more instructions may be executed several times depending on some conditions. It used two structures called the Do while and repeat until. Both these structures are used for looping.




0 comments:
Post a Comment