retagged by
7,827 views

3 Answers

Best answer
11 votes
11 votes

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

Input                                                      stack

( ( ) ( ( ) ) ( ( ) ) )                                   empty

( ) ( ( ) ) ( ( ) ) )                                       (      [Push]

) ( ( ) ) ( ( ) ) )                                         ((     [Push]

( ( ) ) ( ( ) ) )                                           ( -->  [pop as parenthesis match]

( ) ) ( ( ) ) )                                             (( [Push]

) ) ( ( ) ) )                                               ((( [Push]

) ( ( ) ) )                                                  ((  -->  [pop as parenthesis match]

( ( ) ) )                                                                  -->  [pop as parenthesis match]

( ) ) )                                                      ((  [Push]

) ) )                                                                      (((  [Push]

) )                                                                         (( [pop]

 )                                                                           ( [pop]

Empty                                                                Empty [pop]

Maximum 3 parenthesis appear at stack at one time

selected by
Answer:

Related questions

1 votes
1 votes
2 answers
1
makhdoom ghaya asked Jun 29, 2016
3,407 views
Searching for an element in the hash table requires $O(1)$ time for the _________time, whereas for direct addressing it holds for the _______ time.worst-case, averagewors...
1 votes
1 votes
1 answer
2
makhdoom ghaya asked Jul 10, 2016
4,510 views
The reverse polish notation equivalent to the infix expression $((A + B) ^{*} C + D)/(E + F + G)$$A B + C ^{*} D + EF + G + /$ $A B + C D ^{*} + E F + G + /$ $A B + C ^{*...
0 votes
0 votes
2 answers
3
go_editor asked Jul 11, 2016
4,888 views
Given an empty stack, after performing push(1), push(2), pop, push(3), push(4), pop, pop, push(5), pop, what is the value of the top of the stack?4321
0 votes
0 votes
2 answers
4
makhdoom ghaya asked Jul 1, 2016
3,365 views
Match the following $:$$\begin{array} {cIcI} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{DDL} & \text{i.} & \text{LOCK TABLE} \\ \text{b.} & \tex...