In this blog post I will attempt to simplify algorithmic design and data structure techniques in developing structured programs. An algorithm is a series or sequence of steps that are taken to accomplish a task or multiple tasks. “Data structures are implemented using algorithms. An algorithm is a procedure that you can write as a C function or program, or any other language. An algorithm states explicitly how the data will be manipulated.” (Shaffer, 2013)
Computer programs follow different sets of rules so that they can operate flawlessly daily with minimal human interference. Algorithms create these rules and before an algorithmic code is created the rules it must follow need to be identified. The process used to create and implement an algorithm is referred to as algorithm design. Each step in an algorithm has its own logical sequence which makes them easy to debug and algorithms are not dependent on a particular programming language.
The complexity of algorithms varies, dependent upon the amount of data it must process, and the time in which it takes to complete the process. The two main complexity measurements to determine the efficiency of an algorithm our time complexity and space complexity. Time complexity is used to describe the amount of time the algorithm takes to complete the task. Time can mean several different things, from the number of memory accesses performed, to the number of comparisons between different integers or the number of times a loop is executed. The space complexity of an algorithm describes the amount of memory or space that the algorithm takes. Fixed length units are used to measure this. Which is usually a measurement in the number of integers used or the number of fixed size structures. Space complexity is often ignored because in modern computing the space that algorithms utilize is minimal, in comparison to the amount of memory, or space available.
Are some algorithms and data structure designs better than others? Yes.
As they say in the mechanical world every tool has its use. The same can be said for different algorithms and different data structure designs.
There are several different types of programming algorithms. Here are just a few.
Sort algorithms
Search algorithms
Hashing
Dynamic Programming
Exponential by squaring
String matching and parsing
Primality testing algorithms
(Indicative Team, 2021)
There are two different data structure techniques which are linear data structures and nonlinear data structures. Linear data structures are structures in which the data is arranged sequentially or linear. Two linear data structures are static data structures and dynamic data structures static data structures have a fixed memory size and dynamic data structures do not. An example of a static data structure is an array an example of a dynamic data structure is a queue or a stack.
Non-linear data structures are data structures in which the information, or data elements are not sequential or linear. Examples of non-linear data structures are trees and graphs. In non-linear data structures the data cannot be traversed in a single run.
Each different programming algorithm and data structure serves a different purpose and are each efficient in their own way. Some algorithms perform specific tasks better than other algorithms, in different scenarios. It is important to utilize algorithmic design and data structure techniques to ensure the most efficient and effective algorithm is created for the task at hand.
References:
GeeksforGeeks. (2022, December 15). Difference between searching and sorting algorithms. GeeksforGeeks. Retrieved March 16, 2023, from https://www.geeksforgeeks.org/difference-between-searching-and-sorting-algorithms/
Geeksforgeeks. (2023, February 15). Algorithms design techniques. GeeksforGeeks. Retrieved April 6, 2023, from https://www.geeksforgeeks.org/algorithms-design-techniques/?ref=gcse
Shaffer, C. A. (2013). Data Structures and Algorithm Analysis. Dover Publications.
Team, W. by I. I. (2021, September 15). What is a programming algorithm? data defined. Indicative. Retrieved April 6, 2023, from https://www.indicative.com/resource/programming-algorithm/
No comments:
Post a Comment