mardi 18 septembre 2018

Write a program to check if the given string is balanced or not (Balancing Parenthesis)

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

  1. Create Stack Using stack mystack;

  2. 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