Newbie to Newbie (Part 2)
Hey there everyone!
This week I will be talking about data structures and algorithms which play an essential role in developing well-structured computer programs. Let’s start by defining the concepts. Data structures organize data to enable efficient access, modification, and processing (Lysecky, Vahid, Lysecky, & Givargis, 2015). Some examples of data structures include arrays, linked lists, stacks, queues, hash tables, trees, heaps, and graphs. An essential aspect of data structures is algorithms (Complexity analysis, n.d). An algorithm is a sequence of instructions used to solve a problem (Shaffer, 2014, p.17). According to Shaffer (2014), problems can be solved using different algorithms. However, one algorithm may be more efficient than another. Therefore, it is crucial to learn how to compare algorithms.
Before implementing an algorithm for a computer program, you must first decide on an appropriate data structure for the program’s requirements. For example, if you want to store data sequentially in the memory, you might choose the array data structure. When the order of actions is vital in storing data, you might go for a stack data structure. It is important to note that data structures and algorithms work hand in hand in program development. Data structures are used to store data, while algorithms “state explicitly how the data will be manipulated” (Complexity analysis, n.d). Data structure and algorithms are mainly about solving problems efficiently.
Is one data structure or algorithm better than than the other?
While some data structure designs are better than others (in certain situations). I wouldn’t say that one is better than another in every case. Choosing the right data structure design depends mainly on the program’s fundamental requirements. The first thing that must be done when selecting a design is considering the input, output, and operations. You must also consider the performance and scale requirements (how much data will be processed and how frequently it will be accessed). This will help you decide on the best data structure for the job.
Algorithms are evaluated for efficiency mainly on their performance before execution and after execution. The performance analysis deals with a time and space complexity analysis. The space complexity of an algorithm is measured by the quantity of memory it needs to run until completion. Time complexity is the number of operations an algorithm must perform to complete its task in connection with its input size (Complexity analysis, n.d). The time complexity of algorithms is measured using the Big O notation. Keep in mind that there is somewhat of a trade-off with the time and space complexity of algorithms. This makes it essential to analyze which factor plays the most prominent role in achieving program efficiency. Understanding data structure and algorithms offer software engineers insight into which structure or algorithm is the best for the program they are creating.
References:
Complexity analysis (n.d.). http://www.cs.utexas.edu/users/djimenez/utsa/cs1723/lecture2.html
Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data structures essentials. https://zybooks.zyante.com/#/zybook/DataStructuresEssentialsR25/chapter/1/section/3
Shaffer, C. A. (2013). Data structures and algorithm analysis (Edition 3.2). http://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdf
Comments
Post a Comment