Mena Sargios
Quiz by , created more than 1 year ago

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

23
0
0
Mena Sargios
Created by Mena Sargios almost 8 years ago
Close

13. Graph Topoligical Sorting

Question 1 of 15

1

a topological sort can be done on a cyclic graph.

Select one of the following:

  • True
  • False

Explanation

Question 2 of 15

1

Select the correct definition.
Topological sorting:

Select one of the following:

  • 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.

Explanation

Question 3 of 15

1

What is Topological Sorting?

Select one of the following:

  • It is finding an ordering of an acyclic graph such that all edges proceed in order.

  • none of the above

Explanation

Question 4 of 15

1

What is not part of algorithm for topological graph?

Select one of the following:

  • A. make a copy of the diagram

  • B.make a list l

  • C.make a q list

  • D.none of the above

Explanation

Question 5 of 15

1

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:

Select one of the following:

  • A.Big o notation

  • B.Ascending

  • C.Topological

  • D.Descending

Explanation

Question 6 of 15

1

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?

Select one of the following:

  • A) to the front of the list

  • B) the end of the list

  • C) the middle of the list

Explanation

Question 7 of 15

1

The algorithm for topological sorting includes

Select one of the following:

  • 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.

Explanation

Question 8 of 15

1

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?

Select one of the following:

  • A) Topological Sorting

  • B) Top-Down Sorting

  • C) Quick Sorting

  • D) None of the above

Explanation

Question 9 of 15

1

Any linear Ordering of all vertices where all the arrows point to the left is a valid solution

Select one of the following:

  • True
  • False

Explanation

Question 10 of 15

1

In order to perform a topilogical sort, the graph must be:

Select one of the following:

  • A. Cyclic

  • B. Acyclic

  • C. A tree

  • D. None of the above

Explanation

Question 11 of 15

1

For any given directed acyclic graph, there could be ______ valid topological sorts.

Select one of the following:

  • A. only one

  • B. only two

  • C. many

  • D. none - topological sorts only work in cyclic graphs

Explanation

Question 12 of 15

1

In an example of topological orders, which of the following is correct?

Select one of the following:

  • 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

Explanation

Question 13 of 15

1

Is topological sorting possible if and only if the graph has no directed cycles?

Select one of the following:

  • True
  • False

Explanation

Question 14 of 15

1

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.

Select one of the following:

  • True
  • False

Explanation

Question 15 of 15

1

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?

Select one of the following:

  • When selecting a vertex to add to the sorted list, you must select a vertex with an outdegree of 0.

  • none of the above

Explanation