What is a common use case for a stack in web browsers?
A. Maintaining a history of visited pages
B. Storing user credentials
C. Caching images
D. Handling cookies
Select an option to see the answer and solution.
Which of the following correctly describes a stack's push operation in terms of its effect on the stack?
A. Adds an element to the top of the stack
B. Removes the top element of the stack
C. Retrieves the top element without removal
D. Checks the stack size
Select an option to see the answer and solution.
What is the maximum number of elements that can be held in a stack if it has a capacity of 20 and 5 elements are pushed and then 3 elements are popped?
Select an option to see the answer and solution.
What type of stack implementation allows for the stack to grow dynamically as needed?
A. Static array implementation
B. Dynamic array implementation
C. Fixed-size array implementation
D. Circular buffer implementation
Select an option to see the answer and solution.
Evaluate the following and choose the correct answer.
a/b+c*d where a=4, b=2, c=2, d=1.
Select an option to see the answer and solution.
What would be the Prefix notation for the given equation?
a+b-c/d&e|f A. |&-+ab/cdef
B. &|-+ab/cdef
C. |&-ab+/cdef
D. |&-+/abcdef
Select an option to see the answer and solution.
What is the time complexity of balancing parentheses algorithm?
A. O (N)
B. O (N log N)
C. O (M log N)
D. O (N2 )
Select an option to see the answer and solution.
Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2)
Select an option to see the answer and solution.
Evaluate the postfix expression ab + cd/- where a=5, b=4, c=9, d=3.
Select an option to see the answer and solution.
What is the correct postfix expression for the following expression?
a+b*(c^d-e)^(f+g*h)-i A. abc^de-fg+*^*+i-
B. abcde^-fg*+*^h*+i-
C. abcd^e-fgh*+^*+i-
D. ab^-dc*+ef^gh*+i-
Select an option to see the answer and solution.
What would be the solution to the given prefix notation?
/ / / 16 4 2 1 Select an option to see the answer and solution.
What is the time complexity of an infix to postfix conversion algorithm?
A. O(N log N)
B. O(N)
C. O(N2 )
D. O(M log N)
Select an option to see the answer and solution.
What would be the Prefix notation and Postfix notation for the given equation?
A+B+C A. ++ABC and AB+C+
B. AB+C+ and ++ABC
C. ABC++ and AB+C+
D. ABC+ and ABC+
Select an option to see the answer and solution.
Is the given statement ((A+B) + [C-D]] valid with respect to balancing of symbols?
Select an option to see the answer and solution.
What would be the Prefix notation for the given equation?
A+B*C^D A. +A*B^CD
B. +A^B*CD
C. *A+B^CD
D. ^A*B+CD
Select an option to see the answer and solution.
What would be the Prefix notation for the given equation?
A^B^C^D A. ^^^ABCD
B. ^A^B^CD
C. ABCD^^^
D. AB^C^D
Select an option to see the answer and solution.
Consider the stack
| 5 |
| 4 |
| 3 |
| 2 |.
At this point, '*' is encountered. What has to be done?
A. 5*4=20 is pushed into the stack
B. * is pushed into the stack
C. 2*3=6 is pushed into the stack
D. * is ignored
Select an option to see the answer and solution.
What would be the solution to the given prefix notation?
- + 1 2 * 3 / 6 2 Select an option to see the answer and solution.
Parentheses are simply ignored in the conversion of infix to postfix expression.
Select an option to see the answer and solution.
What is the time complexity for converting decimal to binary numbers?
A. O(1)
B. O(n)
C. O(logn)
D. O(nlogn)
Select an option to see the answer and solution.