BY
HARSHITA RAWAT
TABLE OF CONTENT
• Depth First Search
• Breadth First Search
Graphs
• Graphs are non-linear data structures consisting of nodes and edges.
• Often the information is stored in the nodes and
relationship/connection between nodes is represented by edges.
Representation of Graphs
Graphs are often represented by :
• Adjacency matrix
• Adjacency list
Depth First Search Algorithm
• Searching depth first
• Uses Stack to represent the next visiting state
• Visit nodes in one branch first and then go to other branches
Breadth First Search Algorithm
• Search breadth first
• Uses queues to represent the next visiting state
• Simultaneously visit nodes in each active branch
THANK YOU