Introduction To Data Structures
Introduction To Data Structures
A data structure is a storage that is used to store and organize data. It is a way of arranging data on
a computer so that it can be accessed and updated efficiently.
A data structure is not only used for organizing the data. It is also used for processing,
retrieving, and storing data. There are different basic and advanced types of data structures that
are used in almost every program or software system that has been developed. So we must have
good knowledge about data structures.
How Data Structure varies from Data Type
The data type is the form of a variable to which a value Data structure is a collection of different kinds of
can be assigned. It defines that the particular variable data. That entire data can be represented using an
will assign the values of the given data type only. object and can be used throughout the program.
The implementation of a data type is known as abstract Data structure implementation is known as concrete
implementation. implementation.
In the case of data types, the value While in the case of data structures, the data and its value
of data is not stored because it only acquire the space in the computer’s main memory. Also, a
represents the type of data that can data structure can hold different kinds and types of data
be stored. within one single object.
Non-primitive Data Structure: Non-primitive data structures are those that are derived from primitive data structures. These data structures cannot be
operated or manipulated directly by the machine level instructions. They focus on formation of a set of data elements that is either homogeneous (same
data type) or heterogeneous (different data type). These are further divided into linear and non-linear data structure based on the structure and
arrangement of data.
● Linear data structure: Data structure in which data elements are arranged sequentially or linearly, where each element is attached to its
previous and next adjacent elements, is called a linear data structure.
Examples of linear data structures are array, stack, queue, linked list, etc.
● Static data structure: Static data structure has a fixed memory size. It is easier to access the elements in a static data structure.
An example of this data structure is an array.
● Dynamic data structure: In the dynamic data structure, the size is not fixed. It can be randomly updated during the runtime which may
be considered efficient concerning the memory (space) complexity of the code.
Examples of this data structure are queue, stack, etc.
● Non-linear data structure: Data structures where data elements are not placed sequentially or linearly are called non-linear data structures. In
a non-linear data structure, we can’t traverse all the elements in a single run only.
Examples of non-linear data structures are trees and graphs.
Need Of Data structure
The structure of the data and the synthesis of the algorithm are relative to each other. Data presentation must be
easy to understand so the developer, as well as the user, can make an efficient implementation of the operation.
Data structures provide an easy way of organizing, retrieving, managing, and storing data.
Here is a list of the needs for data.
1. Data structure modification is easy.
2. It requires less time.
3. Save storage memory space.
4. Data representation is easy.
5. Easy access to the large database.
Summary
● Data structure.
● Diff between data type and data structure.
● Classification of data structure
○ Linear data structure
○ Non-linear data structure.
● Need of data structure