Filters
Question type

Study Flashcards

The smallest sum of edge weights between two vertices describes which of the following?


A) the shortest path
B) topological order
C) topological sort
D) maximum spanning tree

E) A) and D)
F) B) and D)

Correct Answer

verifed

verified

What can be described as the assignment of a rank to each vertex in a graph such that the edges go from lower-to higher-ranked vertices?


A) directed acyclic graph
B) sparse graph
C) topological order
D) shortest-path problem

E) B) and C)
F) B) and D)

Correct Answer

verifed

verified

In a component with n vertices, how many edges are in the spanning tree?


A) n
B) n 2
C) n + 1
D) n - 1

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

An example of a process or model that can be graphed is the links between pages on the Internet.

A) True
B) False

Correct Answer

verifed

verified

In the LinkedDirectedGraph class, which of the following methods is an iterator?


A) incidentEdges
B) getEdge
C) containsEdge
D) sizeEdges

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

In the pseudocode for the dfs function for partitioning the vertices in a graph into disjointed components, what is the missing pseudocode statement? dfs(graph, v, s) : Mark v as visited S.add(v) For each vertex, w, adjacent to v: If w is unvisited: <missing pseudocode>


A) s.add(w)
B) dfs(graph, v, s)
C) s.add(v)
D) dfs(graph, w, s)

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

The depth-first traversal of a graph uses a queue as the collection in the generic algorithm.

A) True
B) False

Correct Answer

verifed

verified

What is the minimum sum of all weights in a spanning tree of a weighted graph?


A) spanning forest
B) minimum spanning tree
C) shortest path spanning tree
D) topological spanning tree

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

What is the performance behavior of a linked adjacency list for determining whether an edge exists between two vertices?


A) constant time
B) O( N 2) where N is the number of vertices
C) linear with the length of the list
D) logarithmic with the total number of vertices

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

In graph terms, what is a path that begins and ends at the same vertex?


A) a simple path
B) an undirected path
C) a cycle
D) a directed path

E) B) and D)
F) C) and D)

Correct Answer

verifed

verified

What makes a graph complete?


A) when there is an edge from each vertex to all other vertices
B) when there is a path from each vertex to all other vertices
C) when there is a path between at least half the vertices
D) when there are two or more edges between vertices

E) C) and D)
F) A) and D)

Correct Answer

verifed

verified

A graph is a set of edges and vertices such that each edge connects two vertices.

A) True
B) False

Correct Answer

verifed

verified

If vertex Penguins can reach vertex Capitals and vertex Capitals can reach vertex Islanders, but none of them can reach vertices Sharks or Ducks, what can you say about the set of vertices Penguins, Capitals, and Islanders?


A) the set is a connected component
B) the set describes a complete graph
C) the vertices in the set are all adjacent to each other
D) the set describes a connected graph

E) A) and C)
F) All of the above

Correct Answer

verifed

verified

Which of the following is true about an undirected graph?


A) a graph-processing algorithm can move in only one direction along an edge that connects two vertices
B) their edges do not indicate direction
C) there can be multiple edges connecting any two vertices
D) there is a source vertex and a destination vertex

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

What is the output of Dijkstra's algorithm?


A) a three-dimensional array
B) a two-dimensional grid
C) a source vertex
D) the number of vertices in the graph

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

In a digraph, each edge has a source vertex and destination vertex.

A) True
B) False

Correct Answer

verifed

verified

In a DAG, there are no cycles.

A) True
B) False

Correct Answer

verifed

verified

Repeated application of finding the minimum spanning tree for all the components in a graph yields a minimum spanning forest for a graph.

A) True
B) False

Correct Answer

verifed

verified

In a complete undirected graph consisting of 3 vertices, how many total adjacencies will there be?


A) 2
B) 6
C) 9
D) 4

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

When you traverse a graph, there is always a single direct link from one item to any other item.

A) True
B) False

Correct Answer

verifed

verified

Showing 21 - 40 of 50

Related Exams

Show Answer