Sign in to save your progress, vote, and build your own decks.Sign in
Balanced Brackets
7 cards·by luc-yahoo
Balanced Brackets is a:
perfect example of a stack
1
check if x is an opening bracket
2.1
always pop y from the stack
3
If made it through the whole thing and stack is empty, return true
2
if x = closing brace
2.2
if y is not the corresponding brace to x, return No
1.1
add to the stack