Tuesday, 24 June 2014

Balanced parenthesis check

Balanced parenthesis check for expression using javascript

Given an expression with series of braces,curly braces and big brackets " () {} [] ", you have to determine that whether these parenthesis are balanced or not. If given a string " ({}) ", by looking at it we can clearly say that parenthesis are balanced. Today we are going to implement this using javascript. We will be using data structure stack.