Data Structures
Data Structures
Data Structures
Classification
A data structure is a collection of data values and the relationships between them. Data
structures allow programs to store and process data effectively.. Some of the most common
data structures are arrays, lists, trees, and graphs.
Data Structure is used for organizing the data in memory. There are various ways of
organizing the data in the memory, for eg. array, list, stack, queue, and many more.!
The data structure isn’t a programming language like C, C++, Java, etc. It is a set of
algorithms that can be used in any programming language to organize the data in the
memory.
As applications are becoming more complex and the amount of data is increasing day by day,
which may cause problems with processing speed, searching data, handling multiple requests
etc. Data structure provides a way of organizing, managing, and storing data efficiently. With
the help of data structure, the data items can be traversed easily. Data structure provides
efficiency, reusability and abstraction. It plays an important role in enhancing the
performance of a program because the main function of the program is to store and retrieve
the user’s data as fast as possible.
Data structure and algorithms are two of the most important aspects of computer science.
Data structures allow us to organize and store data, while algorithms allow us to process that
data in a meaningful way. Learning data structure and algorithms will help you become a
better programmer.
Primitive Data Structures directly operate according to the machine instructions. These are
the primitive data types. Data types like int, char, float, double, and pointer are primitive data
structures that can hold a single value.
Non-primitive data structures are complex data structures that are derived from primitive data
structures. Non – Primitive data types are further divided into two categories.
Linear Data Structure consists of data elements arranged in a sequential manner where every
element is connected to its previous and next elements. This connection helps to traverse a
linear arrangement in a single level and in a single run. Such data structures are easy to
implement as memory is additionally sequential. Some examples of Linear Data Structure are
List, Queue, Stack, Array etc.
1] Arrays –
A linked list is a linear data structure that is used to maintain a list-like structure in the
computer memory. It is a group of nodes that are not stored at contiguous locations. Each
node of the list is linked to its adjacent node with the help of pointers.
3] Stack –
Stack is a linear data structure that follows a specific order during which the operations are
performed. The order could be FILO (First In Last Out) or LIFO (Last In First Out).
Queue is a linear data structure in which elements can be inserted from only one end which is
known as rear and deleted from another end known as front. It follows the FIFO (First In
First Out) order.
Non-linear Data Structures do not have any set sequence of connecting all its elements and
every element can have multiple paths to attach to other elements. Such data structures
support multi-level storage and sometimes can’t be traversed in a single run. Such data
structures aren’t easy to implement but are more efficient in utilizing memory. Some
examples of non-linear data structures are Tree, BST, Graphs etc.
1] Tree –
A tree is a multilevel data structure defined as a set of nodes. The topmost node is named
root node while the bottom most nodes are called leaf nodes. Each node has only one parent
but can have multiple children.
General Tree
Binary Tree
Binary Search Tree etc
2] Graph
Types of Graph
Finite Graph
Infinite Graph
Trivial Graph
Simple Graph
Null Graph
Pseudo Graph
Classification of Data Structure
Static Data Structures are data structures where the size is allocated at the compile time.
Hence, the maximum size is fixed and cannot be changed.
Dynamic Data Structures are data structures where the size is allocated at the run time.
Hence, the maximum size is flexible and can be changed as per requirement.
Data Structure Operations –
The common operations that can be performed on the data structures are as follows:
Searching – We can easily search for any data element in a data structure.
Sorting – We can sort the elements either in ascending or descending order.
Insertion – We can insert new data elements in the data structure.
Deletion – We can delete the data elements from the data structure.
Updation – We can update or replace the existing elements from the data structure.
Advantages of Data Structure –
10. Software that renders graphics (such as a web browser or 3D rendering software)