UGC NET Paper 2 (Computer Science)Hard

Given a grammar in Chomsky Normal Form, the CYK algorithm decides whether a string of length n belongs to the language in time:

  1. A. O(n^2)
  2. B. O(n^3)
  3. C. O(n log n)
  4. D. O(2^n)

Correct answer: B. O(n^3)

CYK fills an n x n table of possible non-terminals for each substring, and combining two sub-intervals at each of O(n) split points for O(n^2) cells costs O(n^3) overall.

More UGC NET Computer Science and Applications questions

Exams that ask this topic