Filters
Question type

Study Flashcards

The number of edges connected to a vertex describes which of the following?


A) a complete graph
B) the neighbor of a vertex
C) the degree of a vertex
D) whether a graph is connected

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

Correct Answer

verifed

verified

On a weighted graph, the vertices are labeled with numbers.

A) True
B) False

Correct Answer

verifed

verified

In an undirected graph, two or more edges connect the same pair of vertices.

A) True
B) False

Correct Answer

verifed

verified

All graphs, except weighted graphs, are collections of vertices connected by edges.

A) True
B) False

Correct Answer

verifed

verified

In Python, you need to define infinity as a long integer.

A) True
B) False

Correct Answer

verifed

verified

Which of the following is NOT true about an adjacency matrix?


A) it stores information about the graph in a grid
B) the grid cell contains a 0 if there is no edge between vertices
C) a graph with four vertices contains 16 cells
D) it can be represented by an array of lists

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

Correct Answer

verifed

verified

In the __init__ method code for the LinkedVertex class, what is the missing code? def __init__(self, label) : Self.label = label Self.edgeList = list() < missing code >


A) self.size += 1
B) self.mark = False
C) return iter(result)
D) result = self.label

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

Correct Answer

verifed

verified

Dijkstra's algorithm consists of two steps: the initialization step and the execution step.

A) True
B) False

Correct Answer

verifed

verified

In a breadth-first traversal of a graph, what type of collection is used in the generic algorithm?


A) queue
B) set
C) stack
D) heap

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

Correct Answer

verifed

verified

Which of the following is true about graph traversals?


A) a single path to each item is assumed
B) all algorithms are nonrecursive
C) the algorithm should find the shortest path to a given item
D) the type of collection used is irrelevant to the traversal algorithm

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

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer