Flashcards on Graph and breadth-first and depth-first search

Graph & Breadth-First and Depth-First Search Explained

1 / 26

What is a graph formally defined as?

A graph G is formally defined as a pair (V, E), where V is a finite set of vertices (also called nodes) and E is a finite set of edges (also called li

Tap to flip · Swipe to navigate

Graph Data Structures

26 cards

Card 1

Question: What is a graph formally defined as?

Answer: A graph G is formally defined as a pair (V, E), where V is a finite set of vertices (also called nodes) and E is a finite set of edges (also called li

Card 2

Question: What do vertices represent in a graph?

Answer: Vertices represent the objects.

Card 3

Question: What do edges represent in a graph?

Answer: Edges represent the relationships between objects.

Card 4

Question: What are the basic units of which a graph is formed?

Answer: Vertices (V)

Card 5

Question: In a social network, what would people be considered?

Answer: Vertices

Card 6

Question: In a road map, what would cities be considered?

Answer: Vertices

Card 7

Question: What are connections between two vertices called?

Answer: Edges (E)

Card 8

Question: Describe an undirected edge (u, v).

Answer: An edge (u, v) implies that the connection goes both ways, from u to v and from v to u.

Card 9

Question: Give an example of an undirected edge.

Answer: A friendship on a social network.

Card 10

Question: Describe a directed edge (u, v).

Answer: An edge (u, v) implies a connection only from u to v, not necessarily from v to u.