The concept of algorithms in the computer

 The concept of algorithms in the computer

not found

If you want the computer to do anything, you must first write a computer program, and to write a computer program, you must tell your computer precisely and in detailed steps what you want it to do, and then the computer will perform these steps professionally, and thus implement the program, leading to the application of the target in question. .

When you ask the computer to do something, you can also choose how to do that thing, and here comes the role of algorithms in the computer, as it is a simple technique to accomplish the intended goal.

In the world of computer programming, there is more than one way, i.e. an algorithm, to accomplish the required tasks and operations, and each algorithm differs with its pros and cons due to its different implementations of operations.1.

types of algorithms

When looking at computer algorithms from the perspective of different ways of working, we get these main types:

  • ranking algorithm

The most widespread and used, as its name suggests, depends on the arrangement of lists, because the work of the computer requires the organization and arrangement of many lists and lists of program commands.

This algorithm is divided into several sub-types as well: quick sort, merge sort, bubble sort, and others.

  • global search algorithm

A method that depends on looking at the solutions, the possibilities available, and choosing the best ones.

  • Divide and Conquer Algorithm

The principle of this algorithm is to break down computer problems into small parts, and then solve them.

  • greedy solution algorithm

A method that solves the problems you face by using the best solutions or methods available at the present time, while completely ignoring the future, or future solutions and methods.

  • dynamic programming algorithm

It depends on extracting or reaching a solution through previous side or small solutions, or studying previous solutions and deducing a new solution from them that fits the situation in front of it, and it is considered one of the latest and most effective algorithms.2.

Examples of Algorithms in Computer

In order to understand how algorithms work in a computer, it is necessary to simplify the matter in a simple example. Let's say that you have a friend who will arrive at the airport in your city, and he has to go from the airport to your home.


From a computer perspective, more than one specific algorithm must be defined with clear steps, in order to accomplish this goal, or sometimes the goal is simple and it is sufficient to select one algorithm to accomplish it, such as the example in which we are talking about receiving a friend from the airport.


For example, we put the taxi ride algorithm, and we put clear and detailed steps for this algorithm: first; Go to a taxi stop, then get in the taxi, giving the taxi driver the home address.


Or we can use a second algorithm, such as relying on bus rides, and any algorithm you follow must be accompanied by neat and clear steps, because as we said, the computer follows these steps carefully.


As we can see, the presence of different types of algorithms is caused by the different way each of them implements the desired goal. The steps of taking a taxi differ from the steps of riding a bus, and just as there are different pros and cons when comparing taking a bus to a taxi, the algorithms in the computer also differ in their efficiency and effectiveness.

Please leave your comment to encourage us

Previous Post Next Post