Data Structures & AlgorithmsHardICPC regional · GATE CS

Problem: The complete directed graph on 4 vertices has an arc in both directions between every pair of distinct vertices. How many directed 3-cycles (simple cycles of length 3, counted once per cycle) does it have?

  1. A. 4
  2. B. 8
  3. C. 24
  4. D. 12

Correct answer: B. 8

Each of the C(4,3) = 4 vertex triples supports 2 directed 3-cycles: 8. Undirected triangles give 4, ordered vertex sequences give 24, and dividing 24 by 2 instead of 3 gives 12.

More Coding Interview Problems questions

Exams that ask this topic