13. Graph Topoligical Sorting

Beschreibung

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU
Mena Sargios
Quiz von Mena Sargios, aktualisiert more than 1 year ago
Mena Sargios
Erstellt von Mena Sargios vor mehr als 7 Jahre
16
0

Zusammenfassung der Ressource

Frage 1

Frage
a topological sort can be done on a cyclic graph.
Antworten
  • True
  • False

Frage 2

Frage
Select the correct definition. Topological sorting:
Antworten
  • A) Given a cyclic digraph find a linear ordering of vertices such that for all edges (v, w) in E, v procedes w in the ordering.
  • B) Given an acyclic undirected graph find a linear ordering of nodes such that for all vertices (v, w) in E, v proceeds w in the ordering
  • C) Given an acyclic digraph find a quadratic ordering of nodes such that for all edges (v, w) in E, v proceeds w in the ordering.
  • D) Given an acyclic digraph find a linear ordering of nodes such that for all edges (v, w) in E, v proceeds w in the ordering.

Frage 3

Frage
What is Topological Sorting?
Antworten
  • It is finding an ordering of an acyclic graph such that all edges proceed in order.
  • none of the above

Frage 4

Frage
What is not part of algorithm for topological graph?
Antworten
  • A. make a copy of the diagram
  • B.make a list l
  • C.make a q list
  • D.none of the above

Frage 5

Frage
Any linear ordering of all of the vertices in which all the arrows go to the right is a valid solution. The statemen is an example of:
Antworten
  • A.Big o notation
  • B.Ascending
  • C.Topological
  • D.Descending

Frage 6

Frage
In the topological algorithm once you select a vertex V with an out outdegree of 0, where do you place the V in the list?
Antworten
  • A) to the front of the list
  • B) the end of the list
  • C) the middle of the list

Frage 7

Frage
The algorithm for topological sorting includes
Antworten
  • a. making a copy of the graph
  • b. initializing a list
  • c. selecting a vertex with an out degree of 0
  • d. all of the above.

Frage 8

Frage
What is any linear ordering of all of the verticies of a graph in which all the arrows go to the right is a valid solution?
Antworten
  • A) Topological Sorting
  • B) Top-Down Sorting
  • C) Quick Sorting
  • D) None of the above

Frage 9

Frage
Any linear Ordering of all vertices where all the arrows point to the left is a valid solution
Antworten
  • True
  • False

Frage 10

Frage
In order to perform a topilogical sort, the graph must be:
Antworten
  • A. Cyclic
  • B. Acyclic
  • C. A tree
  • D. None of the above

Frage 11

Frage
For any given directed acyclic graph, there could be ______ valid topological sorts.
Antworten
  • A. only one
  • B. only two
  • C. many
  • D. none - topological sorts only work in cyclic graphs

Frage 12

Frage
In an example of topological orders, which of the following is correct?
Antworten
  • A. any nonlinear ordering of all of the vertices in which all the arrows go to the right
  • B. any linear ordering of all of the vertices in which all the arrows go to the right
  • C. any linear ordering of all of the vertices in which all the arrows go to the left
  • D. any linear ordering of all of the vertices in which all the arrows are static

Frage 13

Frage
Is topological sorting possible if and only if the graph has no directed cycles?
Antworten
  • True
  • False

Frage 14

Frage
Is the example topological orders true or false? Any linear ordering of all of the vertices in which all the arrows go to the right is a valid solution.
Antworten
  • True
  • False

Frage 15

Frage
Given this sudo-method: list digraph::topoSort() { // make a copy of digraph G // make a list l // for each vertex in G // select a vertex v with an outdegree of 2 // add v to the front of l // delete v and it's edges from the digraph } What is the problem with this method?
Antworten
  • When selecting a vertex to add to the sorted list, you must select a vertex with an outdegree of 0.
  • none of the above
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

2. Red Black Tree
Mena Sargios
12. Graph Traversal
Mena Sargios
5. B-Tree
Mena Sargios
3. 2-3 Tree
Mena Sargios
7. Algorithm Growth Rate
Mena Sargios
16. Greedy Algorithm (Huffman code)
Mena Sargios
4. 2-3-4 Tree
Mena Sargios
14. Graph Shrtest Path
Mena Sargios
1. Trees Splay Trees
Mena Sargios
10. Hashing Collision
Mena Sargios
15. Graph Spanning Tree
Mena Sargios