Algorithm and Data structure (Lecture # 4)
Algorithm: A step by step solution to a problem is called algorithm A typical programming task can be divided into two phases. 1) Problem Solution Phase Produce an ordered sequence of steps that deserve solution of problem. This sequence of steps is called an algorithm. 2) Implementation Phase Implement the program in some programming language. - First produce a general algorithm (one can use pseudo code) 3) Pseudo code Pseudo code is an artificial and informal language that helps programmer develop an algorithm Pseudo code is very similar to everyday English - And algorithm is a step by step solution of a specific mathematical or computer related problem. Approaches to write algorithm There two different approaches to written algorithm 1. Formal style algorithm Heading of algorithm Step by step algorithm - - - Exit 2. Informal style algorithm It is written in a human language e.g, English suits a pure pseudo cod