Data structures and algorithms are vital elements in many computing applications. When programmers design and build applications, they need to model the application data. What this data consists of depends on the purpose and context of the application. However, it is generally a requirement for any application to insert, edit and query a data store. Data structures offer different ways to store data items, while the algorithms provide techniques for managing this data.

Application Data

Computing applications use many different types of data. Some applications model data within database systems, in which case the database system handles the details of choosing data structures, as well as the algorithms to manage them. However, in many cases, applications model their own data. When programmers decide what type of data structure to use for a particular set of data in an application, they need to take into account the specific data items to be stored, the relationships between data items and how the data will be accessed from within the application logic.

Storage Structures

Programming languages offer a range of data structure options. When programmers choose data structures for their applications, they consider the nature of the data as well as what the application is going to do with it. Arrays are among the most common data structures. An array can store a series of data values in a linear structure, with each element accessed using its index position within the data. Some data structures prevent programs from storing duplicate values, while others allow them. Some data structures maintain a system of ordering for the items stored, while others do not.

Searching

When a program attempts to search a data structure for a particular item, it uses an algorithm. An algorithm is a process, defined in code, for carrying out a specific task. Searching a data structure is one of the most common programming activities and can involve many different types of algorithm. When programmers implement algorithms for searching data structures in their applications, they try to make these algorithms as efficient as possible to maximize on performance.

Sorting

Depending on the data structures and processes involved in an application, it may become necessary to sort the data stored within it. Different data structures enforce certain constraints on applications. For example, if a program is using a data structure such as a list, but this data structure only allows new items to be added at one end, the resulting store will comprise data that is not ordered. Sorting algorithms allow programmers to either rearrange data structures, ordering them by value, or to copy the items in order, into a second data structure.

Recursion

Algorithms for managing data structures sometimes involve recursion. With recursion, an algorithm calls itself, which means it repeats its own processes as part of a looping structure, with each step simplifying the problem at hand. Recursive algorithms can allow programmers to implement efficient sorting and searching techniques within their applications. However, writing recursive algorithms can be difficult for beginners, as it does require a significant amount of practice.

About the Author

Sue Smith started writing in 2000. She has produced tutorials for companies including Apex Computer Training Software and articles on computing topics for various websites. Smith has a Master of Arts in English language and literature, as well as a Master of Science in information technology, both from the University of Glasgow.