We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
And you don't really need that line, if length is 0 the code skips the loop and check if the new stack is empty(which it is) and returns true. You could just do return expressionStack.isEmpty(); to save some line
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
And you don't really need that line, if length is 0 the code skips the loop and check if the new stack is empty(which it is) and returns true. You could just do return expressionStack.isEmpty(); to save some line