Data Structure
Dr Swati Gupta, Ms Suman & Ms Neetu Chauhan
Faculty
School of Engineering & Technology
K.R. Mangalam University
Introduction to Data Structure
Dr. Swati, Ms Suman & Ms Neetu
Session Agenda
Session 1 :
Key Learning Outcome
Background
Why we use Data Structures: Understanding the significance of
Data Structure
Introduction of Data Structure and ADT
Static and Dynamic Implementations
Examples of Data Structures
Real-life applications
Dr. Swati, Ms Suman & Ms Neetu
Key Learning Outcomes
Students will be able to recall fundamental data structures
such as arrays, linked lists, stacks, queues, trees, and graphs,
along with their properties and operations.
Students will understand the underlying principles behind
various data structures, including how they are implemented,
their time and space complexities, and their suitability for
different problem-solving scenarios.
Students will be able to apply appropriate data structures to
solve computational problems efficiently, demonstrating
proficiency in algorithm design and implementation.
Students will be capable of evaluating the performance and
effectiveness of different data structures and algorithms
Dr. Swati, Ms Suman & Ms Neetu
Applications
Real World Applications :
• A simple question Paper is an array of numbered questions
with each of them assigned some marks.
• Book titles in a Library Management System.
• Online ticket booking.
• Contacts on a cell phone.
• For CPU scheduling in computer.
• Web pages can be accessed using the previous and the
next URL links which are linked using a linked list.
• To keep track of turns in a multi-player game, a circular
linked list is used.
Dr. Swati, Ms Suman & Ms Neetu
Applications (Cont..)
Real World Applications :
• It can be used to implement Stacks, Queues, Graphs, and
Trees.
• Back button.[LIFO]
• History of visited pages.
• Last Hired, First Fired - which is typically utilized when a
company reduces its workforce in an economic recession.
• Wearing/Removing Bangles, Pile of Dinner Plates,
Stacked chairs.
Dr. Swati, Ms Suman & Ms Neetu
Applications (Cont..)
Real World Applications :
• Operating System uses queues for job scheduling.
• To handle congestion in the networking queue can be used.
• Data packets in communication are arranged in queue format.
• Server while responding to request
• In Escalators, Printer spooler, Car washes queue.
• Priority queues are used in file-downloading operations in a
browser
• Vehicle at the toll center.
• Google’s Knowledge Graph also has to do something with Graph.
Dr. Swati, Ms Suman & Ms Neetu
Applications (Cont..)
Real World Applications :
• The GPS navigation system also uses shortest path APIs.
• MS Excel uses DAG (Directed Acyclic Graphs).
• Scientific Computations, Flight Networks, Page ranking.
• The decision-based algorithm is used in machine learning
which works upon the algorithm of the tree.
• Databases also use tree data structures for indexing.
• Domain Name Server(DNS) also uses tree structures.
• Shopping on a tight budget but want to buy gifts for all
family members.
• Sudoku solver
Dr. Swati, Ms Suman & Ms Neetu
Brain Exercise
Give some examples of uses of data
structure in our day to day life
Dr. Swati, Ms Suman & Ms Neetu
Definition of Data Structure
"A data structure is a way of organizing information in a computer so that it can
be used effectively." - Donald Knuth
"A data structure is a systematic way of organizing and accessing data." - Clifford
A. Shaffer
"A data structure is a way to store and organize data in order to facilitate access
and modifications." - Cormen, Leiserson, Rivest, and Stein
"A data structure is a systematic way to organize and access data." - Robert
Sedgewick
"A data structure is a systematic way of organizing and accessing data." - Mark
Allen Weiss
Dr. Swati, Ms Suman & Ms Neetu
Basic Terminologies
Data: are simply a value or a set of values of different type which is
called data types like string, integer, char etc.
Structure: a way of organize information, so that it is easier to use.
Data Structure: It is a particular way of organizing data in a
computer so that it can be used efficiently.
Dr. Swati, Ms Suman & Ms Neetu
Why Data Structure?
Human requirements with computers are going complex day by day.
To solve the complex requirements in efficient way we need this
study.
-- Space
-- Time
Provide fastest solution of human requirements.
Dr. Swati, Ms Suman & Ms Neetu
Exploration of Data Structure
Logical or mathematical description of the structure.
Implementation of structure on a computer using different computer
languages (C, C++, JAVA, Python, C#, Javascript, Ruby, Go, Swift
and Scala etc.)
Quantitative analysis of the structure, which includes determining
the amount of memory needed to store the structure and the time
required to process the structure.
Dr. Swati, Ms Suman & Ms Neetu
Classification of Data Structure
Dr. Swati, Ms Suman & Ms Neetu
Primitive Data Structure
Data Structures that are directly operated upon the machine-level
instructions.
Integer, Floating-point number, Character constants, string
constants, pointers etc . Fall in this category.
Dr. Swati, Ms Suman & Ms Neetu
Common operations on Primitive Data Structure
Create
Selection
Updating
Destroy or Delete
Dr. Swati, Ms Suman & Ms Neetu
Non Primitive Data Structure
The data structures that are derived from the primitive data
structures are called non-primitive data structure.
The non-primitive data structures emphasize on structuring of a
group of homogenous (same type) or heterogeneous (different
type) data items.
Dr. Swati, Ms Suman & Ms Neetu
Further classification of Non Primitive Data Structure
Linear Data Structures:
The data structure in which the elements are homogenous and are in
a sequence to form a linear series.
Easy to implement as memory of computer organized in a linear
fashion.
Example- Stack, Queue and Linked List
Non- Linear Data Structure
The data structure in which a data item is connected to several other
data items.
They exhibit either a hierarchical relationship or parent-child
relationship.
Example- Trees and Graphs
Dr. Swati, Ms Suman & Ms Neetu
Common operations on Non-Primitive Data
Structure
Traversal
Insertion
Selection
Searching
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Array:
An array is a type of linear data structure that is defined as a
collection of elements with same or different data types. They exist
in both single dimension and multiple dimensions.
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Stack:
Stack is a linear data structure that follows a particular order in
which the operations are performed. The order may be LIFO(Last
In First Out) or FILO(First In Last Out).
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Queue:
A queue can be defined as an ordered list which enables insert
operations to be performed at one end called REAR and delete
operations to be performed at another end called FRONT.
Queue is referred to be as First In First Out list.
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Linked Lists:
A linked list is a linear data structure which can store a collection of
"nodes" connected together via links i.e. pointers. Linked lists
nodes are not stored at a contiguous location, rather they are linked
using pointers to the different memory locations. A node consists of
the data value and a pointer to the address of the next node within
the linked list.
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Trees:
A tree data structure is a hierarchical structure that is used to
represent and organize data in a way that is easy to navigate and
search. It is a collection of nodes that are connected by edges and
has a hierarchical relationship between the nodes.
Dr. Swati, Ms Suman & Ms Neetu
Types of Data Structure (Cont..)
Graphs:
A Graph Data Structure is a collection of nodes connected by edges.
It’s used to represent relationships between different entities. Graph
algorithms are methods used to manipulate and analyze graphs,
solving various problems like finding the shortest path or detecting
cycles.
Dr. Swati, Ms Suman & Ms Neetu
MCQs
Q1 What is a data structure?
a) A programming language
b) A collection of algorithms
c) A way to store and organize data
d) A type of computer hardware
Q2 What is a bit array?
a) Data structure that compactly stores bits
b) Data structure for representing arrays of records
c) Array in which elements are not present in continuous locations
d) An array in which most of the elements have the same value
Dr. Swati, Ms Suman & Ms Neetu
MCQs
Q3 Which data structure is based on the Last In First Out (LIFO)
principle?
a) Tree
b) Linked List
c) Stack
d) Queue
Q4 Which of the following is not the type of queue?
a) Priority queue
b) Circular queue
c) Single ended queue
d) Ordinary queue
Dr. Swati, Ms Suman & Ms Neetu
References
https://archive.org/details/datastructuresal0000weis_j8p1
https://edutechlearners.com/download/Introduction_to_algorithms-
3rd%20Edition.pdf
Classification-of-data-structure.png (890×477) (geekspartner.com)
memory-allocation.png (559×397) (scientecheasy.com)
https://www.sanfoundry.com/1000-data-structure-questions-answers/
https://www.tutorialspoint.com/data_structures_algorithms/array_data_structure.ht
m
https://media.geeksforgeeks.org/wp-content/uploads/20220816162225/Queue.png
https://www.simplilearn.com/ice9/free_resources_article_thumb/Linked-List-
Soni/representation-of-linked-list.png
https://miro.medium.com/v2/resize:fit:7954/1*q0tQ1svUWfN05kWsZ_Uo2g.jpeg
Dr. Swati, Ms Suman & Ms Neetu
THANK YOU
Dr. Swati, Ms Suman & Ms Neetu