Polynomial Algorithms for Deterministic Pushdown Automata