A algorithm it is a set of instructions designed to perform a specific task. That is, it is a systematic procedure that in a finite number of steps produces the answer to a question or the solution of a problem. An example of an algorithm is that of the Google search engine, in which when inserting a word, it gives several results in the form of web pages.
It can be a complex process, like playing a music file, or a simple operation, like adding two numbers. In computer programming, algorithms are created as functions. These functions are small programs that can be referenced by a larger program.
An image viewing application can contain a library of functions, each using a particular algorithm to represent different image file formats..
An image editing program may contain algorithms designed to process image data. Some examples are cropping, resizing, sharpening, blurring, reducing red-eye, and enhancing color..
Article index
The algorithm must be clear and unambiguous. Each of your steps or actions must be precisely defined, rigorously clear in all respects, and must unequivocally have only one meaning..
An algorithm has zero or more inputs, taken from a specific set of objects. If the algorithm indicates that input data should be taken, this input data should be well defined.
The algorithm always has one or more outputs, which have a relationship to the inputs. The algorithm must clearly define what output information will be produced and must also be well defined.
The algorithm must be finite, that is, it must always terminate at some point, after a finite number of steps, and not get hooked on infinite loops or the like.
The algorithm must be clever and simple, in such a way that it can be executed without problem with the available resources. Therefore, it must not contain any future technology.
The designed algorithm must be independent of the language, that is, it must consist only of simple instructions that can be implemented in any programming language and, however, the result is always the same, as expected.
There are always different ways to perform a specific operation within a program. Therefore, programmers seek to create the most efficient algorithms possible..
With the use of very efficient algorithms, it can be guaranteed that the programs run at the highest speed, using a minimum of system resources.
However, algorithms are not always produced flawlessly the first time. For this reason, developers are looking to improve them to include them in future software updates..
Therefore, whenever a new version of an application with better performance is known, it means that this version contains more efficient algorithms.
The algorithm is an extremely useful instrument, used to carry out work. In computing, choosing the best algorithm ensures that the computer does the given task in the best possible way.
Therefore, it serves to optimize a computer program with the available resources. That is, when you decide to solve a problem through the best algorithms, you want the best combination of program speed and lower memory consumption.
The different algorithms that can be studied are as varied as the problems they solve. However, it is very likely that the problem you are trying to solve is similar to another problem in some respects..
By understanding a wide range of algorithms, you can choose the most suitable for a problem and apply it correctly.
These algorithms are specifically tuned and optimized for the types of files they are targeting. For example, each audio format uses a different way of storing data. When decoded by the audio codec, it will generate a sound file similar to the original waveform.
Algorithms are also used to protect data or communication lines. Instead of storing compressed data so that it uses less disk space, it is stored in a way that other programs cannot detect it. When data is encrypted, what is stored does not look like what is.
To get a computer to do something, you have to write a computer program. To write this program you have to tell the computer, step by step, what you want it to do.
The computer then runs the program, performing each instruction automatically, to achieve the final result. As well as indicating what to do to the computer, you can also choose how it will do it, through the algorithm, being the basic technique used to do the work.
Let's say you have a friend who arrives at the airport and needs to go from the airport to our house. These are four different algorithms that could be given to solve this situation:
- When the plane arrives, call my cell phone.
- Meet me outside the baggage claim area.
- Go to the taxi rank.
- Get in a taxi.
- Give the driver my address.
- Leaving the airport, take bus number 70.
- When you get to Main Street, take bus 14.
- Get off at Elmo Street.
- Walk two blocks north to my house.
- Take a shuttle to the place where they rent cars.
- Rent a vehicle.
- Follow the GPS instructions to get to my house.
All four algorithms accomplish the exact same goal, but each does it differently. Each algorithm also has a different cost and travel time. Therefore, the algorithm is chosen according to the circumstances.
The algorithm must have certain resources to be able to read the values from an external source. Most algorithms require some data values to define a specific problem. For example, the coefficients of a polynomial.
The algorithm must have certain resources to be able to perform arithmetic calculations, comparisons, check logical conditions, etc..
The algorithm must have certain means to be able to choose between two or more possible courses of action, based on initial data, user input and / or calculated results..
The algorithm must have certain means to be able to repeatedly execute a set of instructions, either for a fixed number of times or until some logical condition is met.
The algorithm must have certain resources to be able to inform the user of the results it has calculated, or to be able to request additional data from the user.
This algorithm is very interesting, because it calls itself with a different value as an input parameter, which it got after having solved the previous input parameter. That is, it calls itself repeatedly until the problem is resolved.
Problems such as the Tower of Hanoi or the deep search of a graph can be easily solved using these types of algorithms..
In these algorithms, it is divided into two parts. In the first part, the problem in question is divided into smaller sub-problems of the same type. Likewise, in the second part its sub-problems are solved, then combining both parts to produce the final solution of the problem..
For example, with these algorithms you can perform combination sorts and quick sorts.
These algorithms work by remembering the results of the previous run and using them to find new results. That is, they solve complex problems by dividing them into multiple simple sub-problems and then solving each one of them, storing them later for later use..
This algorithm blindly searches all possible solutions to find one or more solutions that can solve a function. You can think of brute force as using all possible combinations of numbers to open a safe..
This algorithm solves problems recursively and tries to solve a problem by solving each part of it. If the solution fails, it is removed and backtracked to find another solution.
That is, this algorithm solves a sub-problem, but if this does not solve the total problem, it undoes the last step and starts again to find the solution to the problem..
This pseudocode finds the factorial of a non-negative integer "N", using a recursion algorithm:
The Fibonacci sequence is a good example of a dynamic programming algorithm. You can see it in this pseudocode:
- If (N = 0 or N = 1), Fibonacci (N) = 0
- If not, Fibonacci (N) = Fibonacci (N-1) + Fibonacci (N-2)
The 8 queens chess problem is a good example. This problem establishes that there are 8 queen pieces on a chess board and they must be placed in such a way that none of the queens is in a position to attack any other after they are organized..
- Algorithm for HIV diagnosis.
- Search engines on the Internet use proprietary algorithms to display the most relevant results from their search index for specific queries..
- Recipes, like mathematical equations, are algorithms.
- Email knows where to send thanks to algorithms.
- The content seen on social networks comes through algorithms. In fact, everything that is done on the web is the product of algorithms.
- Video games are algorithmic storytelling.
- Smartphone apps are just algorithms.
- Most financial transactions are carried out using algorithms.
- Every time a column is sorted in a spreadsheet, algorithms intervene.
Yet No Comments