DEV Community

Cover image for What are Algorithm's?
Oscar Ortiz
Oscar Ortiz

Posted on

What are Algorithm's?

Algorithm Definition

A set of basic elementary instructions put together to help solve a more complex problem

Seriously, there is no need for algorithms to be beyond the grasp of most people. Yes there are some very complex algorithms out there that help us do more complex things like machine learning, sorting data, and others.

A familiarity with algorithms introduces us to a new way of algorithmic thinking: a way of reasoning to solve problems in a practical way so that efficient implementations of algorithms as programs can run fast in computers.

Preface

It's nearly impossible to cover the whole concept behind Algorithms in just this article, which is why I will only be going over on their purpose and how they work. In most case scenarios someone has probably already came across the same problem you are trying to solve and managed to come up with an algorithm and might have shared it online. Another thing why it is important as a developer to do some research first before trying to spend so much time on something that possibly has already been solved and explained how the process to solving it became available. There are so many algorithms that we have to choose among the vast majority of algorithms available to us to see which is best to solve our problem. It is possible for many algorithms to solve the same problem, but this is where performance comes into play.

Why Algorithms?

At the end of the day Algorithms have been with us for centuries, it is not something that came around simply because of computers. Computers just allowed us to use algorithms differently to solve complex problems at such a fast rate that it'd take for ever for the human to solve with just our brain.

For example, the number system that we use in today's modern time, we take it for granted and might not realize it. Dividing, Multiplication, etc, is also an algorithm, but it took generations for us as humans to develop a number system to teach in schools to help kids learn how to solve problems with numbers, now a days we simply just use a calculator, but a few hundred years ago, only a few minority of people had this knowledge before it was available for everyone. So why should algorithms be limited to only a small group of people when it can make a huge difference if new comers were able to grasp it and know how to use these tools. So in simple terms, Algorithm is just a keyword that describes there is some steps being taken to get some type of output from it.

You could be tempted to think that algorithms are something that we do with computers, but this would be wrong. It is wrong because we've had algorithms way before we had access to computers

How are Algorithms used?

In today's world of the internet there are now hundreds of Algorithms that have been implemented to help solve specific problems. One of the most basic and common one that we might see every where is a SORT Algorithm. For example when buying shoes, we might want to see the shoes in Alphabetical Order (sort algorithm), or from Low to High price range (sort).

A popular one would be part of the most famous Search Engine Sites Google called PageRank.

This Algorithm is a way of measuring the importance of website pages. It was developed by Sergey Brin and Larry Page. It's not the only algorithm used by the search engine but it was the first that was used by the company and it is best known. There are many popular one's that are known for their powerful outputs, Binary Search, Breadth First Search, Depth First Search, Insertion Sort, Merge Sort, and much more. All of these different ways of solving problems have their Pros & Cons to them, so it is always important to do research and find what is best for the best output if you are looking for efficient performance.

What if there is no algorithm?

Typically new algorithms ideas are always making appearances but the most popular ones are that manage to get things done quickly and efficiently since they’ve already proved to work. But that doesn’t mean you can’t come up with your own, sometimes you can use these tools as starting examples to your own conclusion.

To come up with your own there are three steps that you need to take into consideration when implementing an algorithm

  1. The steps are put in a sequence
  2. Steps that determine which following steps should be followed where a test takes place to determine to stop or keep going.
  3. These steps can be put into a loop or iteration where they are executed repeatedly.

Conclusion

At the end of the day you could use a good amount of popular algorithms to solve the same issue, but some might not perform as efficient or fast as others. It is up to the developer (team) to decide what will be best.

I hope by the end of this article you managed to learn something new. It is very important to understand how your code fully works, not only does it help you become a better developer but can also help you use the tools you are working with more efficient.

These articles are mostly intended for personal use on becoming a better programmer, writer, and grow my programming skills. Feel free to drop any feedback or corrections that you believe that should be made to help me and others. Thank you for your time for sticking this far!

Follow me on Twitter for any future article suggestions you’d like to see about.

Top comments (0)