CYK algorithm (source code)

= CYK algorithm
{c}
{wiki}

The CYK algorithm decides membership in a <context-free language> given by a grammar in <Chomsky normal form>. It records, for every substring, the nonterminals that derive that substring and combines adjacent substrings using binary productions. For a word of length $n$ and a fixed grammar, it runs in $O(n^3)$ time.