From one newbie to another - Algorithmic design and data structure techniques.




Hi, and welcome to my latest blog, “How to apply algorithmic design and data structure techniques in developing structured programs for Newbies.” Yes, I know this is a long title but I’m glad you found this page. As with my previous blog on Object-oriented Programming, this was a learning experience on algorithmic design and data structure techniques and how they can apply to the real world. Thank you for taking the time to read and I hope you find this blog informative as well.

 

Our first question is, “How to apply algorithmic design and data structure techniques in developing structured programs.”.

You’re probably wondering why there’s a picture of delicious lasagna and what that has to do with our blog topic. Well, before we dive into that, let’s go over some concepts of algorithmic design.

What exactly is algorithmic design? This concept, in short, refers to the process of creating step-by-step instructions to solve a problem or perform a task. This concept can be applied to anything we do in the real world. From getting ready for work to cooking our favorite meal, there are steps behind each of those tasks that help us get to the end goal. The same is with applying algorithmic design in structured programs. To get the results, we need to follow some steps. One example in the computer science world would be sorting a list of unsorted numbers. In Java (mentioned in my previous blog), this can be completed by using the sort() method within the code. Another sort example is the insertion sort which categorizes the input into two parts, a sorted and an unsorted part, and will continually insert the following value from the unsorted section into the sorted section. Both examples are concepts of algorithmic design with a set of steps that are compiled to create a sorted list and produce the output.

In short, algorithmic design is a set of steps to complete a given task.

 

What are data structure techniques? I’m glad you asked.

Let’s go back to the concept of cooking. When you want to cook a meal, there are certain items you need to do so. These include, but are not limited to; a pan, a spatula or spoon, an oven/stove, etc. These are essentially the “tools” required to make your ever-so-delicious meal. That is basically what data structure techniques are, the tools, or in Java language, the functions. In order to produce an output of code, these functions are needed. Some of these functions, or techniques are as follows:

Arrays: The simplest data structure which is a collection of the same data elements in contiguous locations.

Linked Lists: Similar to an array and a collection of multiple items of the same type but differs in where elements are not stored in contiguous locations.

Stacks: This is a Last In, First Out (LIFO) concept meaning the last element on the stack will be the first element out.

Queues: This is a First In, First Out (FIFO) concept meaning the elements are added to the end of the list and removed from the beginning.

Trees: A tree is just as it sounds, a hierarchy containing multiple nodes that connect to one another symbolizing a tree.

Combining both the algorithmic design and the various data structure techniques will assist a programmer in any language to get to the perfect end result, such as the cooking process and tools that would produce that perfect lasagna.

 

Are some algorithms and data structure designs better than others?

This is a loaded question. While many may argue that all algorithms and data structure designs are the same, not all combinations will work for the job at hand. In short, it all depends on what task needs to be completed. Some items to consider when comparing different algorithms and data structures are the time it takes to complete a task, the space or amount of memory required, the ability to maintain the program, as well as the ability to adapt to changes within the code. Overall, the best approach to finding the algorithm and data structure is to plan accordingly and consider the best combination that is designed for your specific needs.

 

How you would apply algorithmic design and data structure techniques in developing structured programs.

As mentioned in the previous question, I feel the best way to apply algorithmic design and data structure techniques in developing structured programs is to evaluate the situation and understand the end goal. Some things to think about would be understanding what needs to be solved and the desired output. From there it can then be calculated on how to best approach the scenario and know which design and structure is required. Will this be a small one-off task that is required or a large complex build that will continuously be used and frequently changing? This can assist in knowing the complexity of the environment and understanding how to best implement the best algorithmic design and data structure techniques. Once everything is configured, it is always best to test, test, test, then test again. As with the lasagna, is there time and space to make the pasta from scratch, or is it best to go for the box? These factors are important to consider every step of the way to ensure a successful and functional program.

 

Now you can see how developing structured programs is very similar to building a lasagna. There are many steps that need to be taken into consideration along with the environment and the required result. Are we cooking for 2 or 15? Does everyone like feta cheese or do we go with only mozzarella? I’m hoping with the information I’ve provided; you now have a better understanding of the importance of each element needed to make that perfect code to satisfy the programming palate.

Thank you for taking the time to read my blog.

So, are you hungry yet? 


References:

Jimenez, D. (n.d.). Complexity Analysis. The University of Texas at Austin.

https://www.cs.utexas.edu/users/djimenez/utsa/cs1723/lecture2.html

Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data structures essentials. zyBooks

Parvez, F. (2023, April 13). Data Structures in Java – A Beginners Guide 2023. Mygreatlearning.com

https://www.mygreatlearning.com/blog/data-structures-using-java/

Programiz.com. (n.d.). Java Algorithms

https://www.programiz.com/java-programming/algorithms

Programming with Mosh. (2019, December 10). Data Structures and Algorithms for Beginners. [Video]. YouTube.

https://www.youtube.com/watch?v=BBpAmxU_NQo

Shaffer, C. (2013, March 28). Data Structures and Algorithm Analysis.

https://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdfLinks to an external site.

simranjenny84. (2023, February 15). Algorithms Design Techniques. Geeksforgeeks.org

https://www.geeksforgeeks.org/algorithms-design-techniques/

Comments

Popular posts from this blog

From one newbie to another - Let's talk Java

Documenting a Day

Network Security