Introduction
to
Data Structures
SUMBITTED by- SUMBITTED to-
DR.ADITYA DUBEY
ASTHA CHAURASIA
INTRODUCTION
DSA 2
Data: Collection of raw facts.
Data structure : representation of the logical
relationship existing between individual
elements of data.
Classification of Data Structure
DSA 3
Description of various
Data Structures : Arrays
DSA 4
An array is a set of finite number of
homogeneous elements.
SingleDimensionArray
Array withone subscript
TwoDimensionArray
◦ Array withtwo subscripts (Rows andColumn)
Multi DimensionArray
◦ Array withMultiple subscripts
◦ Operations-T
raversing,Searching,Insertion,Deletion,Sorting,Merging
Stack
Stack :a linear data structure which follows a
particular order in which the operations are
performed.
Insertion of element into stack is called PUSH and
deletion of element from stack is calledPOP.
The order may be LIFO(Last In First Out) or
FILO(First In Last Out).
Other operation:peek(),
size(),isEmpty()
DSA 5
Queue
A queue is an ordered collection of items where an
item is inserted at one end called the “rear” and an
existing item is removed at the other end, called the
“front”.
Queue is also called as FIFO
In the queue only two operations are allowedenqueue
and dequeue.
Enqueue means to insert an item into back of the
queue.
Dequeue means removing the front item.The people
standing in a railway reservation row are an example of
queue.
Other operation:size(),isEmpty()
48
DSA
Types of Queues
DSA 7
Queue can be of four types:
o Simple Queue
o Circular Queue
o Priority Queue
o De-queue ( Double Ended Queue)
Lists
A lists (Linear linked list) can be defined as a
collection of variable number of data items
called nodes.
Lists are the most commonly used non-
primitive data structures.
Each nodes is divided into two parts:
◦ information .
◦ o The second part contains the memory addressof
the next node in the list.Also called Link part.
◦ Operation: Creating,Traversing,Inserting,Deleting,Searching,Merging
DSA 8
Lists
DSA 9
Types of linked lists:
◦ Single linked list
◦ Doubly linked list
◦ Single circular linked list
◦ Doubly circular linkedlist
Binary Tree
A binary tree is an ordered tree in which each internal node
can have maximum of two child nodes connected to it.
A binary tree consists of:
◦ A node ( called the root node)
◦ Left and right sub trees.
A Complete binary tree is a binary tree in which each leaf is at the same
distance from the root i.e. all the nodes have maximum two subtrees.
Binary tree using array represents a node
which is numbered sequentially level by
level from left to right. Even empty nodes
are numbered.
DSA 10
Graph
DSA 11
A graph is a set of vertices and edgeswhich
connect them.
A graph is a collectionof nodes called vertices
and the connection between them callededges.
Definition:A graph G(V,E) is a set of vertices V
and a set of edges E.
Types of Graphs:
◦ Directed graph
◦ Undirected graph
◦ Simple graph
Graph
DSA 12
Types of Graphs:
◦ Directed graph
◦ Undirected graph
◦ Simple graph
◦ Weighted graph
◦ Connected graph
◦ Non-connected graph
Thank you
DSA 13

datastructureppt-190327174340 (1).pptx

  • 1.
    Introduction to Data Structures SUMBITTED by-SUMBITTED to- DR.ADITYA DUBEY ASTHA CHAURASIA
  • 2.
    INTRODUCTION DSA 2 Data: Collectionof raw facts. Data structure : representation of the logical relationship existing between individual elements of data.
  • 3.
    Classification of DataStructure DSA 3
  • 4.
    Description of various DataStructures : Arrays DSA 4 An array is a set of finite number of homogeneous elements. SingleDimensionArray Array withone subscript TwoDimensionArray ◦ Array withtwo subscripts (Rows andColumn) Multi DimensionArray ◦ Array withMultiple subscripts ◦ Operations-T raversing,Searching,Insertion,Deletion,Sorting,Merging
  • 5.
    Stack Stack :a lineardata structure which follows a particular order in which the operations are performed. Insertion of element into stack is called PUSH and deletion of element from stack is calledPOP. The order may be LIFO(Last In First Out) or FILO(First In Last Out). Other operation:peek(), size(),isEmpty() DSA 5
  • 6.
    Queue A queue isan ordered collection of items where an item is inserted at one end called the “rear” and an existing item is removed at the other end, called the “front”. Queue is also called as FIFO In the queue only two operations are allowedenqueue and dequeue. Enqueue means to insert an item into back of the queue. Dequeue means removing the front item.The people standing in a railway reservation row are an example of queue. Other operation:size(),isEmpty() 48 DSA
  • 7.
    Types of Queues DSA7 Queue can be of four types: o Simple Queue o Circular Queue o Priority Queue o De-queue ( Double Ended Queue)
  • 8.
    Lists A lists (Linearlinked list) can be defined as a collection of variable number of data items called nodes. Lists are the most commonly used non- primitive data structures. Each nodes is divided into two parts: ◦ information . ◦ o The second part contains the memory addressof the next node in the list.Also called Link part. ◦ Operation: Creating,Traversing,Inserting,Deleting,Searching,Merging DSA 8
  • 9.
    Lists DSA 9 Types oflinked lists: ◦ Single linked list ◦ Doubly linked list ◦ Single circular linked list ◦ Doubly circular linkedlist
  • 10.
    Binary Tree A binarytree is an ordered tree in which each internal node can have maximum of two child nodes connected to it. A binary tree consists of: ◦ A node ( called the root node) ◦ Left and right sub trees. A Complete binary tree is a binary tree in which each leaf is at the same distance from the root i.e. all the nodes have maximum two subtrees. Binary tree using array represents a node which is numbered sequentially level by level from left to right. Even empty nodes are numbered. DSA 10
  • 11.
    Graph DSA 11 A graphis a set of vertices and edgeswhich connect them. A graph is a collectionof nodes called vertices and the connection between them callededges. Definition:A graph G(V,E) is a set of vertices V and a set of edges E. Types of Graphs: ◦ Directed graph ◦ Undirected graph ◦ Simple graph
  • 12.
    Graph DSA 12 Types ofGraphs: ◦ Directed graph ◦ Undirected graph ◦ Simple graph ◦ Weighted graph ◦ Connected graph ◦ Non-connected graph
  • 13.