Definition Of Algorithm in Coding
An Algorithm is therefore a sequence of computational steps that transform input into output.
We can also think of an algorithm as a tool for solving a well-specified computational problem.
Problem Statement:
A problem statement generally specifies what is required input/output relationship. The algorithm describes a specific calculation procedure for achieving this input/output relationship.
For Example:
we may need to sort a sequence of numbers in non-descending order. This problem occurs frequently in practice and provides fertile ground for it.
Since many programs use it as an intermediate step, order is an essential operation in informatics. As a result, we have a large amount of good sorting algorithms that we have available.
It depends on which algorithm is best for the application.
Items are already somewhat sorted, possibly limiting item values, computer architecture and the type of storage devices to be used: main memory, disks, or even tapes.
Working of Algorithm:
- An algorithm is said to be correct if it stops with s for each input instance correct output. We say that the correct algorithm solves the given computation problem.
- An incorrect algorithm may not stop at all on some input instances, or it may stop with an incorrect answer. Contrary to what you might expect, incorrect. Algorithms can sometimes be useful if we can control their error rate.
- When we study algorithms for finding large prime numbers. However, we usually will focus only on the right algorithms. a precise description of the calculation procedure is to be followed.
What kinds of problems do algorithms solve?
Sorting is by no means the only computational problem that algorithms solve was developed. (You probably guessed that when you saw the size of this one.Case Study:
- The Human Genome Project has made great progress toward its goals of identifying and sequencing all 100,000 genes in human DNA
- The 3 billion chemical base pairs that make up human DNA store this information in databases and develop tools for data analysis. Each of these steps requires sophisticated algorithms. Although the solutions to the various problems are beyond the scope of this book, there are many methods to solve them.
- Biological problems using ideas enable scientists to complete tasks while using resources efficiently. The savings are both in time, human, and machine, as well as in money because more information can be obtained from laboratory techniques.
- An oil company may want to know where to place your wells to maximize your expected profit.
- Political candidates may want to determine where to spend money to buy an ad campaign.
- An airline can wish to allocate crews to flights in the least expensive way possible and ensure that every flight is covered and that government regulations regarding crew schedules are met. The ISP may want to specify where to place additional resources to serve its customers more effectively.
- We are given a mechanical design in terms of a parts library where each part may include instances of other parts, and we must list those parts in order that each part appears before the part that uses it. If the proposal contains n parts, then there are n Å of possible orders, where n Å denotes a factorial function.
- Since the factorial function grows faster than even the exponential function, we can't feasibly generate every possible order and then validate it within this order, each part appears before the parts that use it (unless we only have several parts). This problem is an example of topological sorting.

0 Comments