are the braces '{'and'}'brackets '['and']'and parentheses '('and')each opening or left delimiter should be matched by closing or right delimiterthat isevery '{should be followed by matching '}and so on alsoopening delimiters that occur later in the string should be closed before those occurring earlier examplesc[da{ [ ] } { ( ] } [ { } ]ea{ ( /correct /correct /not correctdoesn' match /not correctnothing matches final /not correctnothing matches opening opening delimiters on the stack the program works by reading characters from the string one at time and placing opening delimiterswhen it finds themon stack when it reads closing delimiter from the inputit pops the opening delimiter from the top of the stack and attempts to match it with the closing delimiter if they're not the same type (there' an opening brace but closing parenthesisfor example)then an error has occurred alsoif there is no opening delimiter on the stack to match closing oneor if delimiter has not been matchedan error has occurred delimiter that hasn' been matched is discovered because it remains on the stack after all the characters in the string have been read let' see what happens on the stack for typical correct stringa{ ( [ ] )ftable shows how the stack looks as each character is read from this string the stack contents are shown in the second column the entries in this column show the stack contentsreading from the bottom of the stack on the left to the top on the right as it' readeach opening delimiter is placed on the stack each closing delimiter read from the input is matched with the opening delimiter popped from the top of the stack if they form pairall is well nondelimiter characters are not inserted on the stackthey're ignored table stack contents in delimiter matching character read stack contents { {{(