51.
Which application of stack is used to ensure that the pair of parentheses is properly nested?

52.
What are the set of functions that are to be executed to get the following output?
cat

54.
What is the time complexity of the following code?
public boolean isBalanced(String exp)
{
	int len = exp.length();
	Stack<Integer> stk = new Stack<Integer>();
	for(int i = 0; i < len; i++)
        {
		char ch = exp.charAt(i);
                if (ch == '(')
                stk.push(i);
                else if (ch == ')')
                {
			if(stk.peek() == null)
                        {
				return false;
			}
			stk.pop();
		}
	}
	return true;
}

Read More Section(Stacks in Data Structures)

Each Section contains maximum 100 MCQs question on Stacks in Data Structures. To get more questions visit other sections.