Saturday, 22 May 2021

The Essentials of Data Structures and Algorithms

 In being new to programming with Java, you must be able to use algorithmic structures and designs. Using data structures and algorithms will enable you to develop complex programs to accomplish tasks. First, let's understand what data structures and algorithms are. Data structures can be thought of as building blocks to your program. Data structures give you the option to store data in a manner where it can be accessed as needed based on your requirements. 

A few data structures and algorithms are considered essentials in programming using Java, and they are Array, Listed List, Hash, Stack, and Queue. An array is a linear data structure, and elements are stored in contiguous memory locations. Some advantages of arrays are that they allow for easy sorting and iteration, allowing random access. Some of the disadvantages are that the size is fixed and difficult to insert and delete. Linked lists are also linear data structures. Some advantages of linked lists are that they are dynamic in size and allow easy insertion and deletion. Some disadvantages are that if the head Node is lost, then the linked list is lost, and no random access is possible. Hashing maps, the element to an address for storage and provides constant-time access. Some advantages of hashing are helping fetching elements in constant time and is an efficient way to store elements. Disadvantages are collision resolution increases complexity.

Stacks are a linear data structure that follows LIFO (Last In First Out). Some advantages are maintaining data in a LIFO manner, and the last element is readily available for use. Disadvantages are manipulation is restricted to the top of the stack, and stacks are very flexible. Queues are linear data structures that follow FIFO (First In First Out). Advantages are that queues maintain data in a FIFO manner, insertion occurs at the rear, and deletion happens from the front. Understanding these data structures and when to apply them will make you a better programmer. All in all, I wouldn't say that one data structure is better than another. In my opinion, the data structure that you use will be determined by the program's requirements and what is needed to be performed.  


References:

Lysecky, R., Vahid, F., Lysecky, S., & Givargis, T. (2015). Data Structure Essentials. Retrieved from https://zybooks.zyante.com/#/zybook/DataStructuresEssentialsR25/chapter/1/section/3


Shaffer, C. A. (2013). Data Structures and Algorithm Analysis. (3.2 ed.). Retrieved from            http://people.cs.vt.edu/~shaffer/Book/JAVA3elatest.pdf

No comments:

Post a Comment

OS Theory Concept Map

  The operating system is one of the most critical parts of a computer system. A computer's operating system includes system software th...