We adopt a dynamic programming technique to limit the computational complexity of the algorithm in Selection.
the algorithm takes polynomial time over the length of the character sequence being processed.