r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

0

u/[deleted] May 08 '15

[deleted]

0

u/Bobshayd May 08 '15

I feel like being a smartass to the reviewer and telling them that I will prove the existence of such an implementation by demonstrating that two stacks is Turing complete, then saying, "hey, look, a Turing machine can be directly implemented on a two-stack machine by pushing the old tape symbol onto one stack, popping the new tape symbol from the other, and updating the state".

0

u/[deleted] May 08 '15

[deleted]

1

u/Bobshayd May 08 '15 edited May 08 '15

A two-pushdown automaton can simulate a Turing machine, and a Turing machine can do anything, so two stacks can compute the world. You can't do a queue with a single pushdown automaton.

→ More replies (3)