A data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.
Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks.
Data structures hide physical implementation of computer’s memory.
Topics covered in this snack-sized chapter:
- Computer’s memory is organized into cells.
There are two main types of Data Structure:
- Each memory cell has a specified memory address and data.
In linear data structures, values are arranged in linear fashion.
Examples of linear data structures in which values are stored in a sequence are:
Non-linear data structure is opposite to linear data structure.
The data values in this structure are not arranged in order.
Examples of non-linear data structures are:
Data structures are generally based on the ability of a computer to fetch and store data at any place in its memory, specified by an address.
Thus the record and array data structures are based on computing the addresses of data items with arithmetic operations; while the linked data structures are based on storing addresses of data items within the structure itself.
The implementation of a data structure usually requires writing a set of procedures that create and manipulate instances of that structure.
The efficiency of a data structure cannot be analyzed separately from those operations.
This observation motivates the theoretical concept of an abstract data type, a data structure that is defined indirectly by the operations that may be performed on it, and the mathematical properties of those operations (including their space and time cost).