Thursday, September 19, 2019

Algorithmic Design and Data Structure


Implementing Algorithms and Data Structure might seem a bit overwhelming at first however even just understanding the basic meaning it a good place to start. An algorithm can be defined as "a sequence of steps for accomplishing a task"(Lysecky, Vahid, Lysecky, and Givargis, 2016).

Taking this into consideration one of the best places to start would be having a full understanding of what the task is that you are trying to accomplish. By doing this you will then be able to decide what type of algorithm or data structure is needed.

For example, if you are just wanting to capture the names of 20 different people you can use something as simple as a list as the data structure. If you want to be able to find a specific person in that list, then you could use a Search algorithm to do this. And in implementing this search you would first have to apply a sort algorithm since a list must be sorted prior to being searched.

If you are needing to do something more complex that may need to store data within several levels you could implement a Tree type data structure. A good example could be something like automobiles. At the top level you just have cars, going down a level you could then provide Car Manufactures, going down another level makes of cars. Below is an example of this.

Tree_example.JPG

Most people automatically hear the word Algorithm and may shy away however there are many different functions that qualify and do not necessarily need to be over-complex. You may have a list of 100 different random numbers and need to get the median number, you can build a small method/function to perform this calculation, and that is an algorithm. However, most high-level programming languages have many built-in functions within a Class already. In Java many different math functions are already pre-loaded within the Math Class, making more complex problems much easier. 

This is also the case with many other algorithms such as sort, search, max, min, etc. And although building many of these functions/methods can be beneficial in certain circumstances there is no need to re-invent the wheel multiple times if the algorithm you are needed to perform is already built into a Class you can call. 

From my limited experience being able to understand and plan through what the actual problem is you are trying to solve or function you are trying to perform is key and can make the rest of the process much easier.

There is almost a numberless amount of algorithms and data structures someone might encounter and work with however many of them share many similarities and actually come from the same type of data structure. I am sure most of you have heard of at least 1 of the following; JSON, XML, HTML and although each of these might have their own differences they all share a similar data structure so they are not so different either.

The best advice I can give from my experience is just like anything else you learn in life whether it's riding a bike or learning a new spoken language or learning to program. Practice every day even if it is only for several minutes!!

Good luck to everyone on your journey!