A data structure is a specialized format for organizing and storing data. In computer science, a data structure is a particular way of organizing data in a computer so that it can be used efficiently. Data structure types include the array, the file, the record, the table, the tree, and so on. Any data structure is designed to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate ways.

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services. Usually, efficient data structures are key to designing efficient algorithms. Data structures can be used to organize the storage and retrieval of information stored in both main memory and secondary memory. Different kinds of data structures are suited to different kinds of applications, for example, relational databases commonly use B-tree indexes for data retrieval, while compiler implementations use hash tables to look up identifiers.