0% found this document useful (0 votes)
24 views5 pages

Stack - MCQ_ Attempt Review

Uploaded by

anneanitap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Stack - MCQ_ Attempt Review

Uploaded by

anneanitap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Started on Monday, 23 September 2024, 2:38 PM

State Finished
Completed on Monday, 23 September 2024, 2:57 PM
Time taken 19 mins 15 secs
Marks 19.00/19.00
Grade 100.00 out of 100.00
Name HARSHINE S 730423243041

Question 1

Correct

Mark 2.00 out of 2.00

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

A. Conversion of an infix to prefix expression

B. Balancing symbols 

C. Conversion of an infix to postfix expression

D. Reversing a stack

Your answer is correct.

The correct answer is:


Balancing symbols

Question 2

Correct

Mark 1.00 out of 1.00

Which of the following are operations of a stack

a. pop 

b. poke

c. push 

d. peek 

Your answer is correct.

The correct answers are:


push,

pop,

peek
Question 3

Correct

Mark 2.00 out of 2.00

Find the error (if any) in the following code snippet for pop operation. void pop() //removing an element from a stack

printf(“%s”, stack[top++]);

A. pop operation is performed, but top moved in wrong direction 

B. compile time error

C. run time error

D. pop operation is performed properly

Your answer is correct.

The correct answer is: pop operation is performed, but top moved in wrong direction

Question 4

Correct

Mark 2.00 out of 2.00

Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?

A. If the precedence of operator is lower, pop two operands and evaluate

B. If the precedence of operator is higher, pop two operands and evaluate 

C. Operand is pushed on to the stack

D. The result is pushed on to the operand stack

Your answer is correct.

The correct answer is:


If the precedence of operator is higher, pop two operands and evaluate
Question 5

Correct

Mark 2.00 out of 2.00

Which data structure is used for implementing recursion?

A. Stack 

B. List

C. Array

D. Queue

Your answer is correct.

The correct answer is:


Stack

Question 6

Correct

Mark 2.00 out of 2.00

Which of the following real world scenarios would you associate with a stack data structure?

A. people standing in a line to be serviced at a counter

B. piling up of chairs one above the other 

C. tatkal Ticket Booking in IRCTC

D. offer services based on the priority of the customer

Your answer is correct.

The correct answer is:


piling up of chairs one above the other
Question 7

Correct

Mark 2.00 out of 2.00

What is the time complexity of pop() operation when the stack is implemented using an array?

A. O(logn)

B. O( N )

C. O(1) 

D. O(nlogn)

Your answer is correct.

The correct answer is:


O(1)

Question 8

Correct

Mark 2.00 out of 2.00

In a stack, if a user tries to remove an element from empty stack it is called _________

A. Underflow 

B. Garbage Collection

C. Overflow

D. Empty collection

Your answer is correct.

The correct answer is:


Underflow
Question 9

Correct

Mark 2.00 out of 2.00

Pushing an element into stack already having five elements and stack size of 5, then stack becomes

A. Crash

B. User flow

C. Underflow

D. Overflow 

Your answer is correct.

The correct answer is:


Overflow

Question 10

Correct

Mark 2.00 out of 2.00

Which of the following applications may not use a stack?

A. Tracking of local variables at run time

B. Data Transfer between two asynchronous process 

C. A parentheses balancing program

D. Compiler Syntax Analyzer

Your answer is correct.

The correct answer is:


Data Transfer between two asynchronous process

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy