100% found this document useful (1 vote)
77 views16 pages

Data Structures - DS Tutorial - Javatpoint

The Data Structures tutorial on javatpoint provides comprehensive coverage of both basic and advanced concepts related to data structures, including arrays, linked lists, stacks, queues, and more. It explains the organization of data in memory, differentiates between primitive and non-primitive data structures, and outlines major operations such as searching, sorting, insertion, and deletion. The tutorial is designed for both beginners and professionals, emphasizing the importance of choosing the right data structure for efficient data management.

Uploaded by

emilratiu00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
77 views16 pages

Data Structures - DS Tutorial - Javatpoint

The Data Structures tutorial on javatpoint provides comprehensive coverage of both basic and advanced concepts related to data structures, including arrays, linked lists, stacks, queues, and more. It explains the organization of data in memory, differentiates between primitive and non-primitive data structures, and outlines major operations such as searching, sorting, insertion, and deletion. The tutorial is designed for both beginners and professionals, emphasizing the importance of choosing the right data structure for efficient data management.

Uploaded by

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

1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint


Home Python Java JavaScript HTML SQL PHP C#

DS Tutorial

DS Tutorial

DS Introduction

DS Algorithm

Asymptotic Analysis

DS Pointer

DS Structure

DS Array

DS Array

2D Array

DS Linked List

Linked List

Types of Linked List

Singly Linked List

Doubly Linked List

Circular Linked List

Circular Doubly List

https://www.javatpoint.com/data-structure-tutorial 1/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Skip list in DS

DS Stack

DS Stack

Array Implementation

next →

Data Structures Tutorial

Data Structures (DS) tutorial provides basic and advanced concepts of Data Structure. Our
Data Structure tutorial is designed for beginners and professionals.

Data Structure is a way to store and organize data so that it can be used efficiently.

Our Data Structure tutorial includes all topics of Data Structure such as Array, Pointer,
Structure, Linked List, Stack, Queue, Graph, Searching, Sorting, Programs, etc.

What is Data Structure?


The data structure name indicates itself that organizing the data in memory. There are
many ways of organizing the data in the memory as we have already seen one of the data
structures, i.e., array in C language. Array is a collection of memory elements in which data is
stored sequentially, i.e., one after another. In other words, we can say that array stores the
elements in a continuous manner. This organization of data is done with the help of an

https://www.javatpoint.com/data-structure-tutorial 2/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

array of data structures. There are also other ways to organize the data in memory. Let's see
the different types of data structures.

The data structure is not any programming language like C, C++, java, etc. It is a set of
algorithms that we can use in any programming language to structure the data in the
memory.

To structure the data in memory, 'n' number of algorithms were proposed, and all these
algorithms are known as Abstract data types. These abstract data types are the set of rules.

Types of Data Structures


There are two types of data structures:

Primitive data structure

Non-primitive data structure

Primitive Data structure

The primitive data structures are primitive data types. The int, char, float, double, and
pointer are the primitive data structures that can hold a single value.

Non-Primitive Data structure

The non-primitive data structure is divided into two types:

Linear data structure

Non-linear data structure

https://www.javatpoint.com/data-structure-tutorial 3/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Linear Data Structure

The arrangement of data in a sequential manner is known as a linear data structure. The
data structures used for this purpose are Arrays, Linked list, Stacks, and Queues. In these
data structures, one element is connected to only one another element in a linear form.

When one element is connected to the 'n' number of elements known as a non-linear
data structure. The best example is trees and graphs. In this case, the elements are
arranged in a random manner.

We will discuss the above data structures in brief in the coming topics. Now, we will see the
common operations that we can perform on these data structures.

Data structures can also be classified as:

Static data structure: It is a type of data structure where the size is allocated at
the compile time. Therefore, the maximum size is fixed.

Dynamic data structure: It is a type of data structure where the size is allocated
at the run time. Therefore, the maximum size is flexible.

Major Operations
The major or the common operations that can be performed on the data structures are:

Searching: We can search for any element in a data structure.

Sorting: We can sort the elements of a data structure either in an ascending or


descending order.

Insertion: We can also insert the new element in a data structure.

Updation: We can also update the element, i.e., we can replace the element with
another element.

Deletion: We can also perform the delete operation to remove the element from
the data structure.

Which Data Structure?


A data structure is a way of organizing the data so that it can be used efficiently. Here, we
have used the word efficiently, which in terms of both the space and time. For example, a

https://www.javatpoint.com/data-structure-tutorial 4/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

stack is an ADT (Abstract data type) which uses either arrays or linked list data structure for
the implementation. Therefore, we conclude that we require some data structure to
implement a particular ADT.

An ADT tells what is to be done and data structure tells how it is to be done. In other words,
we can say that ADT gives us the blueprint while data structure provides the
implementation part. Now the question arises: how can one get to know which data
structure to be used for a particular ADT?.

As the different data structures can be implemented in a particular ADT, but the different
implementations are compared for time and space. For example, the Stack ADT can be
implemented by both Arrays and linked list. Suppose the array is providing time efficiency
while the linked list is providing space efficiency, so the one which is the best suited for the
current user's requirements will be selected.

Advantages of Data structures


The following are the advantages of a data structure:

Efficiency: If the choice of a data structure for implementing a particular ADT is


proper, it makes the program very efficient in terms of time and space.

Reusability: The data structure provides reusability means that multiple client
programs can use the data structure.

Abstraction: The data structure specified by an ADT also provides the level of
abstraction. The client cannot see the internal working of the data structure, so it
does not have to worry about the implementation part. The client can only see
the interface.

Data Structures Index

DS Basics Singly Linked List Programs

DS Tutorial Program to create and display a singly


DS Introduction linked list
DS Algorithm Program to create a singly linked list of
Ds Asymptotic Analysis n nodes and count the number of
DS Pointer nodes
https://www.javatpoint.com/data-structure-tutorial 5/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

DS Structure Program to create a singly linked list of


n nodes and display it in reverse order
DS Array
Program to delete a new node from

Array the beginning of the singly linked list

2D Array Program to delete a new node from


the middle of the singly linked list
DS Linked List Program to delete a node from the
end of the singly linked list
Linked List
Program to determine whether a
Insertion at beginning
singly linked list is the palindrome
Insertion at end
Program to find the maximum and
Insertion after specified node
minimum value node from a singly
Deletion at beginning
linked list
Deletion at end
Program to insert a new node at the
Deletion after specified node
middle of the singly linked list
Traversing
Program to insert a new node at the
Searching
beginning of the singly linked list
Doubly Linked List
Program to insert a new node at the
Insertion at beginning
end of the singly linked list
Insertion at end
Program to remove duplicate
Insertion after specified node
elements from a singly linked list
Deletion at beginning
Program to search an element in a
Deletion at end
singly linked list
Deletion of node having given
Program to sort the elements of the
data
singly linked list
Traversing
Program to swap nodes in a singly
Searching
linked list without swapping data
Circular Linked List
Program to swap the last element of
Insertion at beginning
the singly linked list from the first one
Insertion at end
Deletion at beginning Doubly Linked List Programs
Deletion at the end
Traversing Program to Convert a Given Binary
Searching Tree to Doubly Linked List

Circular Doubly List Program to Create a Doubly Linked

Insertion at beginning List From a Ternary Tree


Insertion at end Program to Create a Doubly Linked
Deletion at beginning List of N Nodes and Count the Number

https://www.javatpoint.com/data-structure-tutorial 6/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Deletion at the end of Nodes


Program to Create a Doubly Linked
DS Stack
List of N Nodes and Display it in
DS Stack Reverse Order

Array Implementation Program to Create and Display a

Linked List Implementation Doubly Linked List


Program to Delete a New Node From
DS Queue the Beginning of the Doubly Linked
List
DS Queue
Program to Delete a New Node From
Array Implementation
the End of the Doubly Linked List
Linked List Implementation
Program to Delete a New Node From
Circular Queue
the Middle of the Doubly Linked List
DS Tree Program to Find the Maximum and
Minimum Value Node From a Doubly
Tree Linked List
Binary Tree Program to Insert a New Node at the
Pre-order Traversal Beginning of the Doubly Linked List
In-order Traversal Program to Insert a New Node at the
Post-order Traversal End of Doubly Linked List
Binary Search Tree Program to Insert a New Node at the
Searching in BST Middle of Doubly Linked List
Insertion in BST Program to Remove Duplicate
Deletion in BST Elements From a Doubly Linked List
AVL Tree Program to Rotate Doubly Linked List
Insertion in AVL Tree by N Nodes
LL Rotation Program to Search an Element in a
LR Rotation Doubly Linked List
RL Rotation
Program to Sort the Elements of the
RR Rotation Doubly Linked List
Deletion in AVL Tree
B Tree Circular Linked List Programs
B+ Tree
Program to Create a Circular Linked
Red Black Tree
List of N Nodes and Count the Number
DS Graph of Nodes
Program to Create a Circular Linked
DS Graph
List of N Nodes and Display it in

https://www.javatpoint.com/data-structure-tutorial 7/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Graph Implementation Reverse Order


BFS Algorithm Program to Create and Display a
DFS Algorithm Circular Linked List
Spanning Tree Program to Delete a New Node From
Prim's Algorithm the Beginning of the Circular Linked
Kruskal's Algorithm List
Program to Delete a New Node From
DS Searching
the End of the Circular Linked List

Linear Search Program to Delete a New Node From

Binary Search the Middle of the Circular Linked List


Program to Find the Maximum and
DS Sorting Minimum Value Node From a Circular
Linked List
Bubble Sort
Program to Insert a New Node at the
Bucket Sort
Beginning of the Circular Linked List
Comb Sort
Program to Insert a New Node at the
Counting Sort
End of the Circular Linked List
Heap Sort
Program to Insert a New Node at the
Insertion Sort
Middle of the Circular Linked List
Merge Sort
Program to Remove Duplicate
Quick Sort
Elements From a Circular Linked List
Radix Sort
Program to Search an Element in a
Selection Sort
Circular Linked List
Shell Sort
Program to Sort the Elements of the
Bitonic Sort
Circular Linked List
Cocktail Sort
Cycle Sort Tree Programs
Tim Sort
Program to Calculate the Difference
Interview Questions Between the Sum of the Odd Level
and Even Level Nodes of a Binary Tree
DS Interview Questions
Program to Construct a Binary Search
Tree and Perform Deletion and Inorder
Traversal
Program to Convert Binary Tree to
Binary Search Tree
Program to Determine Whether all
Leaves are at Same Level

https://www.javatpoint.com/data-structure-tutorial 8/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Program to Determine Whether two


Trees are Identical
Program to Find Maximum Width of a
Binary Tree
Program to Find the Largest Element
in a Binary Tree
Program to Find the Maximum Depth
or Height of a Tree
Program to Find the Nodes Which are
at the Maximum Distance in a Binary
Tree
Program to Find the Smallest Element
in a Binary Tree
Program to Find the Sum of all the
Nodes of a Binary Tree
Program to Find the Total Number of
Possible Binary Search Trees with N
Keys
Program to Implement Binary Tree
using the Linked List
Program to Search a Node in a Binary
Tree

Prerequisite
Before learning Data Structure, you must have the basic knowledge of C.

Audience
Our Data Structure tutorial is designed to help beginners and professionals.

Problem
We assure that you will not find any problem in this Data Structure tutorial. But if there is
any mistake, please post it in the contact form.

Next Topic Data Structure Introduction

https://www.javatpoint.com/data-structure-tutorial 9/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

next →

Related Posts

DS Structure
Structure A structure is a composite data type that defines a grouped list of variables that
are to be placed under one name in a block of memory. It allows different variables to be
accessed by using a single pointer to the structure. Syntax struct structure_name { ...

 1 min read

Asymptotic Analysis
As we know that data structure is a way of organizing the data efficiently and that
efficiency is measured either in terms of time or space. So, the ideal data structure is a
structure that occupies the least possible time to perform all its operation and...

 9 min read

DS Algorithm
What is an Algorithm? An algorithm is a process or a set of rules required to perform
calculations or some other problem-solving operations especially by a computer. The
formal definition of an algorithm is that it contains the finite set of instructions which are
being carried in...

 9 min read

DS Introduction
An Introduction to Data Structures Since the invention of computers, people have been
using the term "Data" to refer to Computer Information, either transmitted or stored.

https://www.javatpoint.com/data-structure-tutorial 10/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

However, there is data that exists in order types as well. Data can be numbers or texts
written on a piece...

 20 min read

DS Pointer
Pointer Pointer is used to points the address of the value stored anywhere in the computer
memory. To obtain the value stored at the location is known as dereferencing the pointer.
Pointer improves the performance for repetitive process such as: Traversing String Lookup
Tables Control Tables Tree Structures Pointer Details Pointer arithmetic:...

 8 min read

Learn Important Tutorial

Python Java

Javascript HTML

Database PHP

https://www.javatpoint.com/data-structure-tutorial 11/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

C++ React

B.Tech / MCA

Data
DBMS
Structures

Operating
DAA
System

Computer Compiler
Network Design

Computer Discrete
Organization Mathematics

https://www.javatpoint.com/data-structure-tutorial 12/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Ethical Computer
Hacking Graphics

Web Software
Technology Engineering

Cyber
Automata
Security

C
C++
Programming

Java .Net

https://www.javatpoint.com/data-structure-tutorial 13/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

Python Programs

Control Data
System Warehouse

Preparation

Aptitude Reasoning

Verbal Interview
Ability Questions

Company
Questions

https://www.javatpoint.com/data-structure-tutorial 14/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

https://www.javatpoint.com/data-structure-tutorial 15/16
1/20/25, 8:52 PM Data Structures | DS Tutorial - javatpoint

https://www.javatpoint.com/data-structure-tutorial 16/16

You might also like