Saturday, October 8, 2016

Verify if the given string is valid parentheses expression in c#

You are given a string with series for parentheses. The parentheses could be only of 3 opening parentheses {, (, [ and 3 closing parentheses }, ), ]. You need to figure out if the given input are valid expression or not. Valid mean if there is proper closing and opening parentheses.

Other details and algorithm can be found here. Below is the c# implementation.

http://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/