Through the concept of
data structure, data can be processed, manipulated and stored.
The unit provides the logic behind the data structures and why they are essential for software development, even though they are hidden.
Data structures are responsible for
creating,
destroying,
selecting,
updating,
searching,
merging,
splitting and
traversing data.
There are different types of data, which are divided into primitive and non-primitive data types.
Primitive data types are integers, floats, characters, and pointers, and
non-primitive data types complex and are assumed as an array, list, and files.
In addition, a data structure can be distinguished into linear and non-linear data structures. When it comes to
linear data tructure, the data are sorted and stored one after the other in the memory.
The required amount of data is fixed before realising this kind of data structure. However, the result of this function can lead to a waste of memory space.
Furthermore, only one element can be attained. Moreover, a linear data structure is an
array,
stack,
queue,
list, and
linked list.
Contrary to the
non-linear data structure, the data are not sorted sequentially. Because of that, every element has a hierarchical relationship with its grandparents, parents, and children.
Thus, the data insertion and deleting do not follow one another. Furthermore, the non-linear data structure uses the storage efficiently and does not need to fix the amount of data at the beginning like the linear data structure.
Examples are the
tree and
graph data structure. A tree data structure sort and store the data in a hierarchical relationship.