diff --git a/parenthesis_matching.cpp b/parenthesis_matching.cpp index bf96404..bbd7cb4 100644 --- a/parenthesis_matching.cpp +++ b/parenthesis_matching.cpp @@ -122,3 +122,68 @@ int main() cout<<"Not Balanced\n"; } +//using stack.h +#include +using namespace std; +#include "stack.h" + +bool balanced(string exp) +{ + Stack s; + //bool res = false; + int l = exp.length(); + for(int i=0; i>exp; + + if(balanced(exp) == 1) + cout<<"Equation is balanced!"<