From c02d95ff33994a4915f059444efaf24a7fbc5de3 Mon Sep 17 00:00:00 2001 From: Tanya Singh Date: Sun, 17 Oct 2021 14:28:38 +0530 Subject: [PATCH] Updated paranthesis_matching.cpp --- parenthesis_matching.cpp | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) 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!"<