|
Definition
Is a way to storing and organizing data into a memory so that it can be used very efficiently.
Types of data structures:
-
Primitive data structure
-
Non-primitive data structure
1. Primitive data structure
A primitive data structures can hold a single value.
Example:
-
int
-
char
-
float
-
double
-
pointer
Non-primitive data structure:
-
Linear data structure
-
Non-linear data structure
Linear data structure
The arrangement of data in a sequential manner is known as a linear data structure.
Example:
-
Arrays
-
Linked list
-
Stacks
-
Queues
Non-linear data structure
When one element is connected to the one or more than one elements known as a non-linear data structure. In non-linear data structures the elements are arranged in a random manner.
Example:
-
Trees
-
Graphs
Data structures can also be classified as:
-
Static data structure: The size is allocated at the compile time. Means maximum fixed size
-
Dynamic data structure: The size is allocated at the run time. Means size is flexible (We can create size as per our requirement)
|