What are Algorithm's?
Tags: programming, algorithms, tutorial, beginners
Published: 2021-08-18 22:56:41

## Algorithm Definition

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


<img width="100%" src="https://www.klipfolio.com/sites/default/files/blog/algotithm.jpg" />

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). 

<img width="100%" src="https://media.giphy.com/media/6HjsxXIeI7SyLTYAok/giphy.gif" />

A popular one would be part of the most famous Search Engine Sites [Google](https://www.google.com/) called __PageRank__. 

<img width="100%" src="https://searchengineland.com/figz/wp-content/seloads/2014/09/google-blueg-algorithm-seo-ss-1920.jpg" /> 

This __Algorithm__ is a way of measuring the importance of website pages. It was developed by [Sergey Brin](https://www.google.com/search?q=sergey+brin&rlz=1C5CHFA_enUS823US823&oq=sergey+brin+&aqs=chrome..69i57j0i512l9.7016j1j7&sourceid=chrome&ie=UTF-8) and [Larry Page](https://www.google.com/search?q=larry+page&rlz=1C5CHFA_enUS823US823&oq=larry+page&aqs=chrome..69i57j46i67i433j0i67l2j0i512l6.1200j0j7&sourceid=chrome&ie=UTF-8). 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](https://www.google.com/search?q=popular+algorithms&rlz=1C5CHFA_enUS823US823&oq=popular+algo&aqs=chrome.1.69i57j0i20i263i512j0i512l3j0i20i263i512j0i512l4.4335j0j7&sourceid=chrome&ie=UTF-8). 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

<img width="100%" src="https://media.geeksforgeeks.org/wp-content/cdn-uploads/Competitive-Programming-1.jpg" />

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](https://mobile.twitter.com/cleveroscardev?lang=en) for any future article suggestions you’d like to see about.