What’s an algorithm

Sai Prabhanj Turaga
3 min readApr 20, 2024

--

One definition might be a set of steps to accomplish a task.

So let’s look at the example where we organize wooden items. So if we want to use these wooden items over here for flooring, we need to accomplish several tasks.

  1. First step is we have to choose flooring, so which color that we are going to use.
  2. Then we need to purchase it and bring it home.
  3. Then the third step is we need to prepare some flooring and the next step is we need to determine the layout of the flooring in the space.
  4. We need to trim the door chasing and our floor is ready.

So as you see, we have completed a set of steps to accomplish our task of flooring. So our data is wooden items over here.

First, we structured them as a data structure. Then we completed the steps, which is a set of rules as mentioned in the definition of the algorithm. So to make a flooring, we have to complete these five steps over here. So these steps together is called an algorithm, which is the set of instructions to complete a task.

Now you have clear understanding of what’s an algorithm.

Every day during our daily lives, we use algorithm to execute our duties.

You might have an algorithm from getting home to work.

  1. So first you need to go to the bus stop.
  2. Then you need to take a bus.
  3. Then you need to go to the office.

So this three steps is an algorithm of going from home to work.

Or you might have an algorithm of buying a coffee from Starbucks.

So to buy a coffee from Starbucks,

  1. You need to go to the Starbucks,
  2. then pay for the coffee,
  3. then get the coffee.

So this three steps is the algorithm of buying a coffee from the Starbucks.

The task that we perform during the day are all algorithms. So every day in our daily lives, we perform several tasks. So to complete a task, we are performing some steps. So this set of instructions, this set of steps is called algorithm.

In computer science an algorithm is a set of rules for computer program to accomplish a task. Learning about different types of algorithm and knowing when to apply them allows us to write time and memory efficient programs.

So let’s look at few famous algorithms that are used by big companies. You might be interested

how do Google and Facebook transmit live video across the Internet?

So the answer is they are using audio and video compression algorithm to transmit videos lively. Or you might be interested which algorithm is used to find the shortest path on the map. So graph algorithms are used in Google, Apple or Microsoft Maps to find the shortest path between two locations.

Algorithm are used in the space exploration as well.

Optimization and scheduling algorithms are used by NASA to arrange solar panels on the International Space Station. So by getting deep knowledge about existing algorithms and applying the right one can make our programs faster. It’s also important to know how to design new algorithms as well as how to analyze their correctness and efficiency.

There are two criteria to make good algorithms.

  1. The first one is it solves the problem correctly
  2. Second one is it does it so efficiently.

In the next article , we will look at why data structures and algorithms are important and why famous companies ask questions related to data structures and algorithms during the interview process from the candidates.

--

--