0% found this document useful (0 votes)
22 views

Types of Data Structure

There are two main types of data structures: linear and non-linear. Linear data structures store elements sequentially in memory and include arrays, stacks, linked lists, and queues. Non-linear structures store data hierarchically to overcome limitations of linear structures and decrease space usage, examples include graphs and trees.

Uploaded by

newone751157
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Types of Data Structure

There are two main types of data structures: linear and non-linear. Linear data structures store elements sequentially in memory and include arrays, stacks, linked lists, and queues. Non-linear structures store data hierarchically to overcome limitations of linear structures and decrease space usage, examples include graphs and trees.

Uploaded by

newone751157
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Types of Data Structure

There are usually just two types of data structures:-

1.Linear Data structure

2.Non-Linear data structure

Linear Data Structures:-


The data is stored in linear data structures sequentially. These are
rudimentary structures since the elements are stored one after the other
without applying any mathematical operations.

Linear data structures are usually easy to implement but since the memory
allocation might become complicated, time and space complexities increase.

Few examples of linear data structures include:-


Array:- In an array, elements in memory are arranged in continuous
memory. All the elements of an array are of the same type. And, the type of
elements that can be stored in the form of arrays is determined by the
programming language.

Stacks:- In stack data structure, elements are stored in the LIFO principle.
That is, the last element stored in a stack will be removed first.

Linked list:- In linked list data structure, data elements are connected
through a series of nodes. And, each node contains the data items and
address to the next node.

Queue:- The queue data structure works in the FIFO principle where first
element stored in the queue will be removed first.

Non-Linear Data Structure:-


Non-Linear data structures store the data in the form of a hierarchy.
Therefore, in contrast to the linear data structures, the data can be found in
multiple levels and are difficult to traverse through.

However, they are designed to overcome the issues and limitations of linear
data structures. For instance, the main disadvantage of linear data structures
is the memory allocation. Since the data is allocated sequentially in linear
data structures, each element in these data structures uses one whole
memory block. However, if the data uses less memory than the assigned
block can hold, the extra memory space in the block is wasted. Therefore,
non-linear data structures are introduced. They decrease the space
complexity and use the memory optimally.

Few types of non-linear data structures are:-

Graphs:- In graph data structure, each node is called vertex and each vertex
is connected to other vertices through edges.

Tree:- Similar to a graph, a tree is also a collection of vertices and edges.


However, in tree data structure, there can only be one edge between two
vertices.
Tries:- A Tries is an advanced data structure that is sometimes also known as prefix
tree or digital tree. It is a tree that stores the data in an ordered and efficient way. We
generally use trie's to store strings.

You might also like