IDEA OF ALGORITHM :
as it is well-known that a computer is a simple but complex machine with no absolute intelligence. As it cannot perform any task on its own, thus it must be instructed in unambiguous steps such that it follows them one after one to get a task executed properly.
Thus it becomes the programmer's duty to precisely define his problem in the form of an algorithm.
An algorithm is a finite sequence of steps or instructions, each of which(instructions) has a clear meaning and can be performed with a finite amount of effort to solve/accomplish the task in a finite length of time. It does not matter what the input values may be, as an algorithm terminates after executing a finite number of instructions. To solve a mathematical or computational, this is the first step of the procedure. Also, an algorithm includes calculations, reasoning, and data processing. algorithms can be represented in natural language, pseudocode, and flowcharts. Thus in many problems that solve some tasks algorithms act imperatives to get the task accomplished genuinely.
Given below is an algorithm that gives the required steps required by a temperature sensor to measure and display temperature on an attached LED screen.
Besides, every algorithm must satisfy these following criteria :
- Input: there must be zero or more quantities, which are externally supplied to process the task;
- Output: for output at least one quantity is produced to show that the task is executed regardless of acceptance;
- Definiteness: for this, each instruction must be clear and unambiguous to be understood by the computer;
- Finiteness: if traced out the instructions and inputs of an algorithm, then for all input cases the algorithm must terminate after a finite number of steps;
- Effectiveness: for this, every instruction must be sufficiently basic so that it can be as a principle to be carried out by a person using only a pencil and paper. It is not enough that each operation must be definite, but it must also be feasible.
{Meanwhile, the formal computer science distinguishes between an algorithm and a program. A program does not necessarily satisfy the fourth condition. One important example of such a
program for a computer is its operating system, which never terminates (except for system crashes) but continues in a wait loop until more jobs are entered.}
Steps involved solving logical and numerical problems by an algorithm:
- STEP 1: Obtain a description of an algorithm.
- STEP 2: Analyze the problem.
- STEP 3: Develop a high-level algorithm.
- STEP 4: Refine the algorithm by adding more details{Stepwise Refinement}.
- STEP 5: Review the algorithm.
Sometimes algorithms are written using pseudocodes, i.e. a language similar to the programming language to be used.
Writing an algorithm for solving a problem offers these advantages:
- Promotes effective communication and understanding of the problem between team members
- Enables analysis of the problem easier.
- Acts as the blueprint for coding of the program.
- Assists in debugging the algorithm.
- Can be used as a part of software documentation for future reference and during the maintenance phases.
PRACTICAL ALGORITHM DESIGN ISSUES :
Choosing an efficient algorithm or data structure for a problem is just one part of the designing process. There are three basic design goals that we should strive for in a program:
1. Try to save time (Time complexity).
2. Try to save space (Space complexity).
3. Try to have a face.
{A program that runs faster is better, so saving time is an obvious goal. Likewise, a program that saves space over a competing program is considered desirable. We want to “save face” by preventing the program from locking up or generating reams of garbled data.}.
0 Comments
Doubts? Please let our team know So that we can serve you better.