Comment on A Brutal Look at Balanced Parentheses, Computing Machines, and Pushdown AutomataparentComments−gpderetta9moWouldn't two counters report "([)]" as being properly balanced?−jibal9moNo, there's an open [ when the ) is encountered. The problem is the other way around -- my algorithm would report [() as an error. Oops, back to the drawing board. Clearly no counting can tell the difference between [() and ([).
Comments
Wouldn't two counters report "([)]" as being properly balanced?
No, there's an open [ when the ) is encountered. The problem is the other way around -- my algorithm would report [() as an error. Oops, back to the drawing board. Clearly no counting can tell the difference between [() and ([).