Data Structures & AlgorithmsEasyAccenture · Cognizant pattern

A simple directed graph (no self-loops, at most one edge from u to v) has 6 vertices. What is the maximum number of edges?

  1. A. 15
  2. B. 36
  3. C. 12
  4. D. 30

Correct answer: D. 30

Every ordered pair (u, v) with u ≠ v can carry an edge: 6 × 5 = 30. 15 = C(6, 2) is the undirected count; 36 would include self-loops.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic