Definition:
Simple definition of Data structure is organizing the data in memory. It is a systematic way to organize data in order to use it efficiently.
There are different ways to organize data in structure. One example is Array. Array is collection of elements i.e., collection of memory locations, it is the memory locations that we store the values. In the array, structure of data is sequential it occupies contiguous memory locations types of data structures.
Type | Description |
Linear | In Linear data structures, the data items are arranged in a linear sequence. Example: Array |
Non-Linear | In Non-Linear data structures, the data items are not in sequence. Example: Tree, Graph |
Homogeneous | In homogeneous data structures, all the elements are of same type. Example: Array |
Non-Homogeneous | In Non-Homogeneous data structure, the elements may or may not be of the same type. Example: Structures |
Static | Static data structures are those whose sizes and structures associated memory locations are fixed, at compile time. Example: Array |
Dynamic | Dynamic structures are those which expands or shrinks depending upon the program need and its execution. Also, their associated memory locations changes. Example: Linked List created using pointers |
Characteristics of a Data Structure:
Time Complexity: Running time or execution time of operations of data structure must be as small as possible.
Space Complexity: Memory usage of a data structure operation should be as little as possible.
Basic Operations:
The data in the DS are processed by certain operations. The particular data structure chosen largely depends on the frequency of the operation that needs to be performed on the DS.
- Searching
- Sorting
- Insertion
- Deletion
- Updation