Data are collections of values of a variable that algorithms operate on. Each data can contain many values called “data item” or “sub-item”. At a higher level of abstraction are the “entities”, “instances”, or “objects” of the class.


Data Structure is a specialized format for organizing, retrieving and storing data in a computer to be accessed and used efficiently. Moreover, data structure frames the organization of information for machines and humans to better understand it.
Data structure comes with three main characteristics: Correctness, Time Complexity and Space Complexity.
- Correctness: the accuracy and reliability of the data structure’s implementation. It should perform operations as expected from the user, handle edge cases, and produce the right results.
- Time Complexity: the efficiency of data structure operations in terms of the number of times required to perform them. This helps the user understand how the runtime of an operation grows as the input size increases.
- Space Complexity: the amount of memory an algorithm requires to perform its tasks effectively on a particular data structure. Ideally, data structures should use as little memory as possible. This is particularly important in resource-constrained environments or when dealing with large datasets.
There are two types of data structures: Primitive data structures and non-primitive data structures.
- Primitive data structures contain the most basic data units available in all programming languages. They include integers, floats, characters, strings, and Booleans.
- Non-primitive data structures are created with primitive data as their building blocks to efficiently organize and manage a collection of data. They can handle different data types and complex operations like searching, sorting, insertion, deletion and more. They fall into two large categories: linear and non-linear structures
- Linear data structures store data in a sequential order allowing for key insertion and deletion operations. Examples are arrays, linked lists, stacks and queues.
- Non-linear data structures store data in a hierarchical or interconnected manner allowing for more complex relationships between data elements. Examples are trees, graphs and hash tables.
DATA STRUCTURES AND ITS IMPORTANCE
Data structures are essential for the following reasons:
- Efficient Data Management: They enable efficient storage and retrieval of data. Reducing processing time and improving performance.
- Data Organization: They organize data in a logical manner, making it easier to understand and access.