Mena Sargios
Quiz von , erstellt am more than 1 year ago

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU

565
1
0
Mena Sargios
Erstellt von Mena Sargios vor mehr als 7 Jahre
Schließen

12. Graph Traversal

Frage 1 von 15

1

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?

Wähle eine der folgenden:

  • Each time you visit a vertex, mark it as queued (visited)

  • none of the above

Erklärung

Frage 2 von 15

1

Match the phrase with the term it describes.
Phrase: "First visited, first explored."

Wähle eine der folgenden:

  • A) Depth-first search

  • B) Post-order traversal

  • C) In order traversal

  • D) Breadth-first search

Erklärung

Frage 3 von 15

1

What is the difference between a depth-first and breadth-first search?

Wähle eine der folgenden:

  • Depth-first uses "first in last out", while Breadth-first uses "first in first out".

  • none of the above

Erklärung

Frage 4 von 15

1

How do you start a depth first search?

Wähle eine der folgenden:

  • A. You take the highest number

  • B.You take the lowest number

  • C.You follow the shortest path

  • D.none of the above.

Erklärung

Frage 5 von 15

1

Graph traversals only visit all the vertices if it's connected.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 6 von 15

1

when traversing a graph what can you do to avoid going through
infinte loops because of cycles?

Wähle eine der folgenden:

  • mark vertices as queued

  • none of the above

Erklärung

Frage 7 von 15

1

When doing a recursive depth first search on a given vertex,
adjacent nodes are visited:

Wähle eine der folgenden:

  • a. in reverse alphanumerical order

  • b. in alphanumerical order

  • c. from left to right

  • d. from right to left

Erklärung

Frage 8 von 15

1

Which type of search proceeds along a path from a vertex v as deeply into
the graph as possible before backing up?

Wähle eine der folgenden:

  • A) Breadth-First Search

  • B) Inorder Traversal

  • C) Depth-First Search

  • D) None of the above

Erklärung

Frage 9 von 15

1

The two different ways to traverse a graph is?

Wähle eine der folgenden:

  • Depth First Search, and Breadth First Search

  • none of the above

Erklärung

Frage 10 von 15

1

A depth-first search traversal on a tree is the same as a:

Wähle eine der folgenden:

  • A. Pre order traversal

  • B. In order traversal

  • C. Post order traversal

  • D. linear traversal

Erklärung

Frage 11 von 15

1

Depth First Search uses a ______ while Breadth First Search uses a ______:

Wähle eine der folgenden:

  • A. stack/recursion, queue

  • B. queue, stack/recursion

  • C. iteration, recursion

  • D. recursion, stack

Erklärung

Frage 12 von 15

1

What does a DFS (depth-first search) do?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 13 von 15

1

What kind(s) of strategy does a Depth-First search use?

Wähle eine der folgenden:

  • A. divide n conquer

  • B. last visited, first explored

  • C. both A and B

  • D. none of the above.

Erklärung

Frage 14 von 15

1

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.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 15 von 15

1

What is the only difference in the BFS and DFS implementations?

Wähle eine der folgenden:

  • BFS uses a queue to store the searched nodes, while DFS uses a stack.

  • none of the above

Erklärung