Data Structures & AlgorithmsModerateTCS NQT · graph theory

Problem: What is the maximum number of edges in a bipartite graph on n vertices with sides of size n/2?

  1. A. n^2 / 2
  2. B. n(n-1)/2
  3. C. n
  4. D. n^2 / 4

Correct answer: D. n^2 / 4

A complete bipartite graph K_{n/2,n/2} has (n/2)^2 = n^2/4 edges, the maximum possible.

More Coding Interview Problems questions

Exams that ask this topic