Write a program to check if the given string is balanced or not (Balancing Parenthesis) If string is balanced print YES else print NO
Mandatory
-
Create Stack Using stack mystack;
-
Use push and pop operations Use mystack.pop for popping an element from the stack , & mystack.push to push an element to the stack;
Use mystack.pop to pop an element and mystack.push to push an element to the stack.
Input: }][}}(}][))]
Output:NO
I am not getting the correct in this.
Aucun commentaire:
Enregistrer un commentaire