SlideShare a Scribd company logo
BREADTH FIRST TRAVERSAL
PRESENTED BY,
AKSHARA.V.B
BREATH FIRST TRAVERSAL:
 Breadth-first search (BFS) is an algorithm for
traversing or searching tree or graph data structures.
 TREE TRAVERSAL: It is the process of visiting each node
in the tree exactly once in same order.
reading or processing data in the node.
 Based on visiting the node, the tree traversal is broadly
classified into 2 types:
* BREADTH FIRST TRAVERSAL
* DEPTH FIRST TRAVERSAL
 In breadth first traversal the node is started from the tree
node and moves down to each level.
EXAMPLE-1:
F
D J
B E G K
A C I
H
L-0
L-1
L-2
L-3
L-4
LEVEL ORDER: F,D,J,B,E,G,K,A,C,I,H
EX:2-Following the concept of QUEUE: FIRST IN FIRST OUT
1
4 2
3
10 9
5
6
7
8
EXAMPLE:3-
The minimum path will be A → B → C → E.
STEPS:
1. Start by putting any one of the graph's vertices at the
back of a queue.
2. Take the front item of the queue and add it to the
visited list.
3. Create a list of that vertex's adjacent nodes. Add the
ones which aren't in the visited list to the back of the
queue.
4. Keep repeating steps 2 and 3 until the queue is empty.

More Related Content

PPTX
data structures and algorithms Unit 2
PPTX
Introduction to Ultra-succinct representation of ordered trees with applications
PDF
Papers We Love Kyiv, July 2018: A Conflict-Free Replicated JSON Datatype
PPTX
Use of the Tree.
PPT
Chapter3.1 3-mikroprocessor
PPT
Textmining Predictive Models
PPTX
Analysis & design of algorithm
PPT
Textmining Retrieval And Clustering
data structures and algorithms Unit 2
Introduction to Ultra-succinct representation of ordered trees with applications
Papers We Love Kyiv, July 2018: A Conflict-Free Replicated JSON Datatype
Use of the Tree.
Chapter3.1 3-mikroprocessor
Textmining Predictive Models
Analysis & design of algorithm
Textmining Retrieval And Clustering

What's hot (16)

PPTX
Shishirppt
PPT
Biconnected components (13024116056)
PPTX
Document clustering for forensic analysis an approach for improving compute...
PDF
Data Structure Basics
PPTX
Tries - Tree Based Structures for Strings
PPTX
TRIES_data_structure
PPT
PPTX
Datamining
PDF
Bfs dfs
PPTX
Graphs, Trees, Paths and Their Representations
PDF
SummaRuNNer: A Recurrent Neural Network based Sequence Model for Extractive S...
PDF
TextRank: Bringing Order into Texts
PPT
PPTX
Density based Clustering Algorithms(DB SCAN, Mean shift )
PPT
Presentation 2009 Journal Club Azhar Ali Shah
Shishirppt
Biconnected components (13024116056)
Document clustering for forensic analysis an approach for improving compute...
Data Structure Basics
Tries - Tree Based Structures for Strings
TRIES_data_structure
Datamining
Bfs dfs
Graphs, Trees, Paths and Their Representations
SummaRuNNer: A Recurrent Neural Network based Sequence Model for Extractive S...
TextRank: Bringing Order into Texts
Density based Clustering Algorithms(DB SCAN, Mean shift )
Presentation 2009 Journal Club Azhar Ali Shah
Ad

Similar to breadth first traversal- tree traversal (19)

PDF
BFS & Interval Graph Introduction
PPT
Data Structures-Non Linear DataStructures-Graphs
PPTX
Presentation on Breadth First Search (BFS)
PDF
U1 L5 DAA.pdf
PPT
22-graphs1-dfs-bfs.ppt
PPTX
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH
PPTX
Bfs present
PPTX
Data structure note
PDF
Link Prediction in the Real World
PPT
22-graphs1-dfs-bfs.ppt odiehehei7hoh97ho7bi6vi6go7gp
PPT
Data Structures 5
PPT
mathematics of network science: basic definitions
PPT
22-graphs1-dfs-bfs.ppt data structures ppt
PPTX
Topic18BinaryTrees.pptx
PDF
Unit ii divide and conquer -2
PDF
Welcome to International Journal of Engineering Research and Development (IJERD)
PPTX
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
PDF
LEC 12-DSALGO-GRAPHS(final12).pdf
PDF
A study on_contrast_and_comparison_between_bellman-ford_algorithm_and_dijkstr...
BFS & Interval Graph Introduction
Data Structures-Non Linear DataStructures-Graphs
Presentation on Breadth First Search (BFS)
U1 L5 DAA.pdf
22-graphs1-dfs-bfs.ppt
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH
Bfs present
Data structure note
Link Prediction in the Real World
22-graphs1-dfs-bfs.ppt odiehehei7hoh97ho7bi6vi6go7gp
Data Structures 5
mathematics of network science: basic definitions
22-graphs1-dfs-bfs.ppt data structures ppt
Topic18BinaryTrees.pptx
Unit ii divide and conquer -2
Welcome to International Journal of Engineering Research and Development (IJERD)
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
LEC 12-DSALGO-GRAPHS(final12).pdf
A study on_contrast_and_comparison_between_bellman-ford_algorithm_and_dijkstr...
Ad

More from AKSHARA V.B (16)

PPTX
Healthcare facilities provided by government hopital in India
PDF
Brain anatomy and physiology
PDF
Rotationplasty
PDF
Lithotripsy
PDF
Biosensor
PPTX
story telling with medical devices
PPTX
Medical gadgets wearable
PPTX
IDENTIFICATION AND IMPACT OF STROKE WITH EEG
PPTX
CATHODE RAY OSCILLOSCOPE
PPTX
basic pictures of biochemistry
DOCX
Vitamin A
PPTX
identification and impact of stoke with eeg
PPTX
Fourier series
PPTX
comprehension- galactic zoo
PPTX
Diathermy
PPTX
Photodiode
Healthcare facilities provided by government hopital in India
Brain anatomy and physiology
Rotationplasty
Lithotripsy
Biosensor
story telling with medical devices
Medical gadgets wearable
IDENTIFICATION AND IMPACT OF STROKE WITH EEG
CATHODE RAY OSCILLOSCOPE
basic pictures of biochemistry
Vitamin A
identification and impact of stoke with eeg
Fourier series
comprehension- galactic zoo
Diathermy
Photodiode

Recently uploaded (20)

PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Presentation on HIE in infants and its manifestations
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
master seminar digital applications in india
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
01-Introduction-to-Information-Management.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Institutional Correction lecture only . . .
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Presentation on HIE in infants and its manifestations
Pharmacology of Heart Failure /Pharmacotherapy of CHF
master seminar digital applications in india
Microbial disease of the cardiovascular and lymphatic systems
102 student loan defaulters named and shamed – Is someone you know on the list?
01-Introduction-to-Information-Management.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
A systematic review of self-coping strategies used by university students to ...
Supply Chain Operations Speaking Notes -ICLT Program
Institutional Correction lecture only . . .
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
VCE English Exam - Section C Student Revision Booklet
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Final Presentation General Medicine 03-08-2024.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Abdominal Access Techniques with Prof. Dr. R K Mishra
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf

breadth first traversal- tree traversal

  • 2. BREATH FIRST TRAVERSAL:  Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures.  TREE TRAVERSAL: It is the process of visiting each node in the tree exactly once in same order. reading or processing data in the node.  Based on visiting the node, the tree traversal is broadly classified into 2 types: * BREADTH FIRST TRAVERSAL * DEPTH FIRST TRAVERSAL  In breadth first traversal the node is started from the tree node and moves down to each level.
  • 3. EXAMPLE-1: F D J B E G K A C I H L-0 L-1 L-2 L-3 L-4 LEVEL ORDER: F,D,J,B,E,G,K,A,C,I,H
  • 4. EX:2-Following the concept of QUEUE: FIRST IN FIRST OUT 1 4 2 3 10 9 5 6 7 8
  • 5. EXAMPLE:3- The minimum path will be A → B → C → E.
  • 6. STEPS: 1. Start by putting any one of the graph's vertices at the back of a queue. 2. Take the front item of the queue and add it to the visited list. 3. Create a list of that vertex's adjacent nodes. Add the ones which aren't in the visited list to the back of the queue. 4. Keep repeating steps 2 and 3 until the queue is empty.