How can stacks be used to check for balanced parentheses in an expression?
-
By counting the number of parentheses
-
By using a queue to store parentheses
-
By pushing opening parentheses onto the stack and popping for closing ones
-
By sorting the parentheses