Back to posts

Algorithmic Design And Data Structure

7/30/2022

 Data structures and algorithms are inter-connected, every program has these two at its core, therefore understanding them better makes you a better programmer. "A data structure is any data representation and its associated operations" (Shaffer, 2013, p. 4), in other words it's a way to organize data the most efficient way. Some examples of data structure are arrays, stacks, queues, trees, and hash tables, among others. When building structure programs, a data structure must be chosen before coming up with an algorithm design. Writing a program is all about solving a problem, before choosing the correct data structure is always a good idea to decide which operations your program will be performing, things like adding, deleting, or finding a particular element. Then, you should evaluate your resources limitations, how much memory can the program afford to use and how fast will it be on average-case or even worst-case scenarios. Only after considering all these characteristics can you determine which data structure would be the best one for your program. After that, is time to design your algorithm, "an algorithm is a method or process followed to solve a problem" (Shaffer, 2013, p. 17). By definition, it must be correct, it should contain steps to follow, and should not be vague about which one is the next step.

Some algorithm designs may be considered better than others in certain cases. If efficiency is a key concern, then a design that is more efficient in terms of time or space complexity may be preferable. If the algorithm or data structure will be used in a real-time system where response time is critical, then a design with a lower worst-case time complexity would be preferable. The design of an algorithm or data structure is important for many reasons. One of the most important concerns is efficiency since the time and space complexity of an algorithm can affect the performance of a system. There are many ways to measure efficiency, one way is to look at how long it takes for the algorithm to run, which is commonly called runtime. Another way is to measure how much memory space it uses, which is called space complexity. If efficiency is a key concern, then a design that is more efficient in terms of time or space complexity may be preferable.

No matter what programming language you use, algorithm design will always be a must have skill in order to build efficient programs. Being able to come up with simple and effective designs is a difficult by vital task. Just like Shaffer (2013) says in his book, a problem can be solved by many algorithm designs, but an algorithm can only solve one problem. Focusing on your program's maintainability, security, space usage, and other resources will be essential when choosing your data structures and designing your algorithms.

Reference:

Shaffer, C. A. (2013). Data structures and algorithms analysis (3.2). Retrieved from

https://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdf