Examples of algorithms – Technology + Computer science

Do you study computer science and algorithms and flowcharts drive you crazy?

VShen you are studying a programming language, the concept of an algorithm is one of the tasks that you should pay the most attention to, as there are many types of algorithms that you will be working with, and you must study them as well.

Here we present to you a wide variety of algorithm examples, which will help you understand or use the concept

Sometimes understand everything mathematical operations linked to algorithms, This can be quite a heinous task.

However, you can always count on the help of articles like this one, in which you will find all the steps and instructions to find the solution to the problem you have encountered.

word image

From this point you will find everything you need to know about algorithms, which can be very helpful in getting the most out of your computer lessons.

Famous and famous algorithms

The algorithm, a word that comes from Latin and which in turn is attributed to a Persian mathematician called Al-Juarismi, It is an ordered set of instructions developed to obtain a solution to a specific problem.

See the full report on what an algorithm is

These algorithms, added to flowcharts which allow them to be created, they are extremely used in logic and mathematics, therefore also in the study of computer science and in other fields such as artificial intelligence.

Although it may seem difficult to understand, you use algorithms in life every day without realizing it. For example when you create a meal.

Google PageRank

PageRank is a set of algorithms developed by Google which is used to rate web pages. This PageRank influences its positioning in the search engine. For this, a series of factors are taken into account, such as:

  • Page refresh rate
  • Quality and quantity of page content
  • Total number of page views
  • Comfort and speed of navigation.

Facebook timeline

The content of what appears in the Facebook Timeline is the product of the operations of the EdgeRank algorithm. This indicates to the user, depending on his activity, what content could be most suitable for him.

To solve the problem of content suitable for each user, the EdgeRank algorithm is based on three conditions:

  • Affinity
  • Content relevance
  • Post time

word image 1

Round Robin algorithm

His name is Algorithm in turn to a sequence of calculation operations which allows the execution of processes, which is also very simple to implement.

For example, in operating systems, this algorithm is used to solve the problem of offering processor time to all operations in a fair but also orderly manner.

With this algorithm, hundreds of sets of instructions can be executed, achieving the maximum performance when executing processes.

Example of a conventional algorithm

A conventional algorithm It’s the one you use every day without realizing it. Getting ready to go to work, preparing breakfast, or drawing conclusions to complete a sequence of steps leading to a specific goal are examples of conventional algorithms.

That is why they involve the use of basic mathematical operations sequences like multiplication, division, addition and subtraction of positive integers.

Example of selective algorithm

Selective algorithms offer the possibility of performing a set of instructions only if a certain condition is met. This condition is generally expressed using propositional logic. It is a logical proposition whose value is “true” or “false”.

  • Problem definition
  • The same statement
  • Problem analysis
  • Outputs: qualification message if the condition is met
  • Entries: evaluation
  • Additional data: Approved if the score is greater than or equal to 7.
  • Statements section:
  • Real var: Cal

Example of calculation algorithm

The computer algorithm It is the main element of any computer program, regardless of the programming language that was used to develop it.

Below is an example of calculation algorithm which can be used in any programming language.

Algorithm for calculating the area of ​​a right triangle:

  • Find the measurements of the base (b) and height (h)
  • Multiply: base times height (bxh)
  • Divide by 2 the result (bxh) / 2

Example of computer algorithm

Algorithms, as mentioned above, are fundamental in computer science. Software developers, with the running the algorithm Before the actual writing of the program, they may be able to troubleshoot any issues that may arise.

Then a computer algorithm it is also an ordered set of processes that execute a series of instructions that provide answers to specific problems.

word image 2

The most common example of algorithm in computer science is the Google search algorithm. When you go to the Google search engine and perform a search, what is executed is an algorithm that returns a series of results.

Also in computer science, a method called “Dynamic programming”, which essentially makes it possible to reduce the execution time of an algorithm thanks to the use of superimposed subproblems and optimal substructures.

This generates better performance of the algorithm.

Example of a qualitative algorithm

The Qualitative algorithms are defined as algorithms that describe step by step the process to be followed in the form of instructions.

In other words, they are algorithms whose resolution does not involve numerical calculations, but logical sequences.

Qualitative algorithm for preparing a tea:

  • You put the water to heat
  • You prepare the cup with the tea
  • Sugar if you want
  • You serve the water in the cup
  • you drink it

Example of a quantitative algorithm

Unlike qualitative algorithms, quantitative are algorithms that depend on mathematical calculations to solve them.

For this, specific calculations are used to define the process, and obtain defined values.

Quantitative algorithm for adding two numbers

  • Start
  • Declare (b, h, a)
  • Enter (b, h)
  • a = (b * h) / 2
  • it will show)
  • The end

Example of a mathematical algorithm

Algorithms also obviously they are widely used in mathematics.

The most common examples of mathematical algorithms are the Euclid’s algorithm to get the greatest common divisor of two positive integers, which is discussed later in this article, the division algorithm to calculate the quotient of two numbers, the multiplication algorithm, to calculate the product, or the Gauss method to solve a system of linear equations.

word image 3

Euclidean algorithm example

In mathematics, Euclid’s algorithm It is used as one of the most efficient ways to calculate the greatest common divisor of two integers, also known as the greatest common factor or greatest common divisor.

Example: Find the gcf of 72 and 16

  • Divide 72 by 16:
  • 72 div 16 = 4.5
  • You multiply the number 16 by the integer part of the result 4.5, that is, by 4:
  • 16 cdot 4 = 64
  • You subtract the number 64 from 72 and we get:
  • 72 – 64 = 8
  • Repeat the steps, taking the divisor, the number 16 and dividing it by the remainder obtained 8:
  • 16 div 8 = 2
  • The gcf of 72 and 16 is the last divisor that gives us an exact result, 8.

Example of a sequential algorithm

A sequential algorithm is an instruction in which one instruction follows another in order. In other words, the output of one instruction is the input of the next and so on until the process is completely terminated.

  • Entrance x
  • Entry and
  • auxiliary = x
  • x = y
  • y = auxiliary
  • Show x
  • Display and

Example of algorithm in everyday life

It is mentioned earlier in this article that you use algorithms without realizing it most of the day. With this, a solution to a certain problem is obtained.

The most common examples of algorithms that you put into practice in everyday life are the ones where you have to follow a sequence of steps to get a product.

In this sense, a cooking recipe is a good choice to clarify things.

  • A cooking recipe starts with the preparations.
  • Make sure you have all the necessary utensils.
  • Otherwise, look for them.
  • Then if you have all the ingredients, you start to cut them.
  • If something is missing, it should be replaced with something else.
  • You put everything in a saucepan or saucepan, and you put it to heat.

Then you eat it. This type of algorithm can also be called “Linguistic or written algorithm ”.

word image 4

Finally, one cannot fail to mention the so-called probabilistic algorithms. These are algorithms based on the result returned by random decisions. This makes it possible to obtain a solution to the problem, always taking into account the distribution of the input data.