Examveda

Complete the given snippet of code for the adjacency list representation of a weighted directed graph.
class neighbor
{
	int vertex, weight;
	____ next;
}
 
class vertex
{
	string name;
	_____ adjlist;
}
 
vertex adjlists[101];

A. vertex, vertex

B. neighbor, vertex

C. neighbor, neighbor

D. vertex, neighbor

Answer: Option C


This Question Belongs to Data Structure >> Graphs

Join The Discussion

Related Questions on Graphs

What is a cycle in a graph?

A. A path that starts and ends at the same vertex with no other repetitions.

B. A path that includes all vertices exactly once.

C. A path with no edges.

D. A complete traversal of all vertices.