the inbuilt class of stack using arrays given in this question has all the stack operations such as stack.push and stack.pop of int type i.e they are taking integral arguments but brackets are not integers then how to do the question.
Stackusingarrayclass
@vaibhavgupta.1919
You have two ways here:
- Either use the Stack already given in the Code Snippet of Integer.Moreover,you are saying that the Stack is of Integer and we are pushing/popping Brackets which is of Char type.
But the Integer Stack will not give exception as it will store characters on the basis of their ASCII Values.
2 Import Java’s Stack.
Hit like if i resolved your doubt satisfactorily else revert back here.