Questão 1
Questão
When you have a cycle in a graph and you are trying to implement a traversal,
what is the most common method to avoid an infinite loop?
Questão 2
Questão
Match the phrase with the term it describes.
Phrase: "First visited, first explored."
Responda
-
A) Depth-first search
-
B) Post-order traversal
-
C) In order traversal
-
D) Breadth-first search
Questão 3
Questão
What is the difference between a depth-first and breadth-first search?
Questão 4
Questão
How do you start a depth first search?
Responda
-
A. You take the highest number
-
B.You take the lowest number
-
C.You follow the shortest path
-
D.none of the above.
Questão 5
Questão
Graph traversals only visit all the vertices if it's connected.
Questão 6
Questão
when traversing a graph what can you do to avoid going through
infinte loops because of cycles?
Responda
-
mark vertices as queued
-
none of the above
Questão 7
Questão
When doing a recursive depth first search on a given vertex,
adjacent nodes are visited:
Questão 8
Questão
Which type of search proceeds along a path from a vertex v as deeply into
the graph as possible before backing up?
Responda
-
A) Breadth-First Search
-
B) Inorder Traversal
-
C) Depth-First Search
-
D) None of the above
Questão 9
Questão
The two different ways to traverse a graph is?
Questão 10
Questão
A depth-first search traversal on a tree is the same as a:
Responda
-
A. Pre order traversal
-
B. In order traversal
-
C. Post order traversal
-
D. linear traversal
Questão 11
Questão
Depth First Search uses a ______ while Breadth First Search uses a ______:
Responda
-
A. stack/recursion, queue
-
B. queue, stack/recursion
-
C. iteration, recursion
-
D. recursion, stack
Questão 12
Questão
What does a DFS (depth-first search) do?
Responda
-
A. it proceeds along a path to a vertex v as deeply into the graph as possible before backing up
-
B. it proceeds along a path from a queue q as deeply into the graph as possible before backing up
-
C. it proceeds along a path from a vertex v as deeply into the graph as possible before backing up
-
D. it proceeds along a path to a queue q as deeply into the graph as possible before backing up
Questão 13
Questão
What kind(s) of strategy does a Depth-First search use?
Questão 14
Questão
Is the definition of depth-first search true or false?
Proceeds along a path from a vertex v as deeply into the graph
as possible before backing up. Using "last visited, first explored" strategy.
Questão 15
Questão
What is the only difference in the BFS and DFS implementations?