WELCOME TO MY
PRSENTATION ON
GRAPH AND TREE
PRESENTEDTO
MOHAMMADSAROWARJAHAN
MORSHED,ASST.PROFECEOR,DEPERTMENTOFCSE,DAFFODIL
INTERNATINALUNIVERSITY
PRESENTED BY
DYUTI ISLAM
ID:151-15-5435
DataStructure
The way of storing data in
computer
Types of data structure
*Linear
*Non -linear
Type of data
structure
Linear data structure
array
Linked lists
Stack
queue
Non-linear data structure
Tree
graph
Graph
WHAT ISGRAPH….? ? ?
In general –
Something written or drawn in a specific way
In mathematics-
A diagram representing a system of
interrelations among two or more things by a
number of distinctive dots, lines, bars etc
Graph
But In
computer
science graphs
are different
than rest of
others
Let’s know more about it….
Graph
A data structure that consists of a set
of nodes (vertices) and a set of edges
that relate the nodes to each other
The set of edges describes
relationships among the vertices
Node
and edges
Formal definition of graph
A graph G is defined as follows:
G=(V,E)
V(G): a finite, nonempty set of vertices
E(G): a set of edges (pairs of vertices)
Classification
of graph
Undirected graph Directed graph
Classification
of graphs
Weighted graph Unweighted graph
Classification
of graphs
Cyclic graph Acyclic graph
C
A
B
Classification
of graphs
IN DEGREE OUT DEGREE
Classifications
of graph
 Directed acyclic graph
Graph coloring
 Two adjacent vertices never get the same color
 Minimum number of color
Graph coloring
Representation
of graph
Adjacency list Adjacency matrix
Graph
algorithm
 Depth first search
Graph
algorithm
 Breadth first search
TREE
leaf
branch
root
InTerms of
data structure
tree is ….
root
leaf
interior
Definition
A tree is a hierarchical representation of a finite set of one or more
data item
Root no parent
Leaf no child
Interior non-leaf
H
E
I
G
H
t
TreeTerminology
Classification
of
Tree
Binary tree
root can have maximum two children
each children is again cab be a binary tree.
Classification
of
Tree
Strict binary tree
root can have exactly two
children or no children at all.
Classification
of
Tree
Complete binary tree
 Mainly strict binary tree
 every leaf node is at same level.
Tree
transversal
Pre-order: (N L R)
Tree
transversal
Post order: (L R N)
Tree
transversal
 In order :(L N R)
Tree
transversal
In order (L N R)
RESOURCES
www.google.com.bd
www.mhprofessional.com
www.assignmentpedia.com
www.cs.utexas.edu
www.slideshare.net/bcadvc/data-
structure
https://www.wikipedia.org
www.slideshare.net
Thank you
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree
Welcome to my prsentation on graph and tree

Welcome to my prsentation on graph and tree