All Exams Test series for 1 year @ ₹349 only
Question

What is the maximum number of parenthesis that will appear on the stack at any one time for parenthesis expression given by

( ( )   ( ( ) )   ( ( ) ) )

This question was previously asked in
UGC NET 2014 Paper 2 Computer Science and Applications Question Paper (28-Dec-2014)
The correct answer is

3

Push on every "(" and pop on every ")", tracking the stack size.

Sizes after each symbol: 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1, 0.

The largest value reached is 3, inside the nested groups.

Check: the stack ends at 0, so the expression is balanced and the count is consistent.

Hence, 3.

Was this answer helpful?

Similar Questions

  1. How many PUSH and POP operations will be needed to evaluate the following expression by reverse polish notation in a stack machine \((A * B) + (C * D/E)\) ?


Important Questions from Stack

  1. Single array a[0: MAXSIZE - 1] is used to implement two stacks. The two stacks grow from apposite ends of the array. Variables top 1 and top 2 (top1 < top2) point to the location of the topmost element in each of the stacks if the space is to be used efficiently, The condition for "stack full" is____________.

  2. Match the following :
    (1) PUSH(a) STACK
    (2) FIFO(b) Stack insertion
    (3) POP(c) QUEUE
    (4) LIFO(d) Stack deletion
  3. What is the final value of the postfix expression BCDAD-+-+.
    where A=2, B=3, C=4, D=5.
  4. Consider the following operations performed on a stack of size 5 :
    Push (a); Pop() ; Push(b); Push(c); Pop();
    Push(d); Pop();Pop(); Push (e)
    Which of the following statements is correct ?
  5. Which of the following is not an inherent application of stack ?
Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
297 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App