0% found this document useful (0 votes)
6 views6 pages

12 - BFS

The document contains a series of questions and answers related to graph theory, including properties of simple graphs, traversal algorithms like Breadth First Search (BFS), and representations of graphs. It discusses concepts such as connected and non-connected graphs, directed and non-directed graphs, and the data structures used in graph traversal. Additionally, it provides explanations of key terms and differences between various types of graphs.

Uploaded by

gigijo2330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

12 - BFS

The document contains a series of questions and answers related to graph theory, including properties of simple graphs, traversal algorithms like Breadth First Search (BFS), and representations of graphs. It discusses concepts such as connected and non-connected graphs, directed and non-directed graphs, and the data structures used in graph traversal. Additionally, it provides explanations of key terms and differences between various types of graphs.

Uploaded by

gigijo2330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Choose the correct answer )1


?Which of the following properties does a simple graph not hold .1
a) Must be connected
b) Must be unweighted
c) Must have no loops or multiple edges
d) Must have no multiple edges

?Which of the following statements for a simple graph is correct .2


a) Every path is a trail
b) Every trail is a path
c) Every trail is a path as well as every path is a trail
d) Path and trail have no relation

?Which of the following ways can be used to represent a graph .3


a) Adjacency List and Adjacency Matrix
b) Incidence Matrix
c) Adjacency List, Adjacency Matrix as well as Incidence Matrix
d) No way to represent

A graph with all vertices having equal degree is known as a .4

a) Multi Graph
b) Regular Graph
c) Simple Graph
d) Complete Graph

For a given graph G having v vertices and e edges which is .5


connected and has no cycles, which of the following statements is
?true
a) v=e
b) v = e+1
c) v + 1 = e
d) v = e-1

Breadth First Search is equivalent to which of the traversal in the .6


?Binary Trees
a) Pre-order Traversal
b) Post-order Traversal
c) Level-order Traversal
d) In-order Traversal

Time Complexity of Breadth First Search is? (V – number of .7


vertices, E – number of edges)
a) O(V + E)
b) O(V)

1
2

c) O(E)
d) O(V*E)

The Data structure used in standard implementation of Breadth First .8


?Search is
a) Stack
b) Queue
c) Linked List
d) Tree

?The Breadth First Search traversal of a graph will result into .9


a) Linked List
b) Tree
c) Graph with back edges
d) Arrays

A person wants to visit some places. He starts from a vertex and .10
then wants to visit every place connected to this vertex and so on.
?What algorithm he should use
a) Depth First Search
b) Breadth First Search
c) Trim’s algorithm
d) Kruskal’s algorithm

Which of the following is not an application of Breadth First .11


?Search
a) Finding shortest path between two nodes
b) Finding bipartiteness of a graph
c) GPS navigation system
d) Path Finding

?When the Breadth First Search of a graph is unique .12


a) When the graph is a Binary Tree
b) When the graph is a Linked List
c) When the graph is a n-ary Tree
d) When the graph is a Ternary Tree

Regarding implementation of Breadth First Search using queues, .13


what is the maximum distance between two nodes present in the
queue? (considering each edge length 1)
a) Can be anything
b) 0
c) At most 1
d) Insufficient Information

?In BFS, how many times a node is visited .14


a) Once
b) Twice

2
3

c) Equivalent to number of indegree of the node


d) Thrice

.15

:in this graph the adjacent for the vertex 1 is


a) {(1,2,5)}
b) {(2,5)}
c) {(2,5,3,4,6)}
d) there are no adjacents for the vertex 1

The Data structure used in standard implementation of .16


? Breadth First Search is

a) MNOPQR

b) NQMPOR

c) QMNROP

d) POQNMR

? ..… A graph is a collection of .17

a) Row and Columns

b) Vertices and edges

c) Equations

d) None of these

? A graph G is called a …….. if it is a connected acyclic graph .18

a) Cyclic graph

b) Regular graph

3
4

c) Tree

d) Not a graph

……… Graphs are represented using.19

a) Adjacency tree

b) Adjacency Linked list

c) Adjacency graph

d) None

Which of the following is useful in traversing a given graph by .20


? breadth first search

a) set

b) List

c) Tree

d) Queue

Choose whether the following is true or )2


: false
. the data structure that is useful in traversing a graph is Lists .1

. Graphs are represented using adjacency lists only .2

.Every Tree is a graph but not every graph is a Tree .3

Breadth First Search is equivalent to pre-order Traversal .4


. traversal in the Binary Trees

.A vertex in graph can’t be connected with itself .5

In a simple graph, the number of edges is equal to twice the .6


sum of the degrees of the vertices

In a connected graph there is at-least one path from every .7


vertex to every other vertex

the Breadth First Search of a graph is unique when the graph is .8


a linked list

4
5

Directed graphs are graphs in which the edges do not have a .9


direction

Time Complexity of Breadth First Search (V – number of .10


? vertices, E – number of edges) is O(V*E)

: answer the following questions )3


? What are the components that a graph consists of .1

Ans : A graph consists of vertices and edges

Vertices: Vertices are similar to nodes. Vertices usually have a label


for identification in addition to other properties. Examples of vertices
.are cities in a map and pins in a circuit

Edges: An edge connects two vertices. Examples of edges are


roadways that connect cities in a map, and traces that connect pins in
.a circuit diagram

What is the difference between connected graph and non- .2


? connected graph

Ans : In a connected graph there is at-least one path from every vertex
to every other vertex

In a non-connected graph every vertex may not be connected to every


.other vertex

What is the difference between directed graph and non-directed .3


? graph

Ans : Directed graphs are graphs in which the edges have a direction.
i.e. you can go from vertex A to vertex B, but you cannot go from
vertex B to vertex A. An example of a directed graph is a one-way
street city map. You can go only one direction on the edge (street) but
.not the other direction

Non-directed graphs are graphs in which the edges do not have a


direction. i.e. you can go from vertex A to vertex B and vice versa. An
example of a non-directed graph is a freeway map connecting cities.
. You can go both directions on the edge (freeway)

Traverse the following graph using Breadth First Search .4


: Technique

5
6

How do you represent components of a graph in a computer .5


? program

Ans : 1. Adjacency matrix - An adjacency matrix is a NxN matrix whose


elements indicate if an edge exists between two vertices. N is the number of
vertices contained in the graph. Usually the value 1 is used to indicate that an
edge exists between two vertices and the value 0 is used to indicate that an
edge does not exist between two vertices.
2. Adjacency List - An adjacency list is an array of lists or sets that contains
the adjacent vertices for each vertex of the graph. The parent list contains N
elements, one element for each vertex in the graph. Each element contains a
list of vertices that that are adjacent to the vertex in the element.

You might also like