D
deanfamily
I have a rather pecurliar C++ assignment. I need to create a program (using a stack or queue) to verify if the grouping symbols in an arithmetic expression match. For example:
{25 + (3 - 6) * 8}
In this case they match (one corresponding left and right bracket for both). In this case:
(25 + (3 - 6} * 8)
they don't match (there is a } that should be a )). If anyone can give me an idea or something to get me heading in the correct direction, I'd appreciate it.
Please note: I HAVE to use a stack or queue.
{25 + (3 - 6) * 8}
In this case they match (one corresponding left and right bracket for both). In this case:
(25 + (3 - 6} * 8)
they don't match (there is a } that should be a )). If anyone can give me an idea or something to get me heading in the correct direction, I'd appreciate it.
Please note: I HAVE to use a stack or queue.