Stack

Stack

University

10 Qs

quiz-placeholder

Similar activities

DFC30233 - Chapter 3

DFC30233 - Chapter 3

University

10 Qs

BCSC0006 - Quiz 3 - Recursion

BCSC0006 - Quiz 3 - Recursion

University

10 Qs

Quiz on Stacks and Data Structures 2

Quiz on Stacks and Data Structures 2

University

10 Qs

DATSRUC Week 6

DATSRUC Week 6

10th Grade - University

15 Qs

Quiz #3 - Infix, Prefix and Postfix

Quiz #3 - Infix, Prefix and Postfix

University

15 Qs

หน่วยการเรียนรู้ เรื่อง สแตก (Stack)

หน่วยการเรียนรู้ เรื่อง สแตก (Stack)

University

10 Qs

BCSC0006 - Quiz 4 - Linked List & Stacks

BCSC0006 - Quiz 4 - Linked List & Stacks

University

10 Qs

unit-2 stack

unit-2 stack

University

10 Qs

Stack

Stack

Assessment

Quiz

Computers

University

Hard

Created by

Kokila Kokila

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Process of inserting an element in stack is called ____________

Create

Push

Evaluation

Pop

Answer explanation

Push operation allows users to insert elements in the stack.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Process of removing an element from stack is called __________

Create

Push

Evaluation

Pop

Answer explanation

Elements in the stack are removed using pop operation. Pop operation removes the top most element in the stack i.e. last entered element.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

Underflow

Empty collection

Overflow

Garbage Collection

Answer explanation

Underflow occurs when the user performs a pop operation on an empty stack. Overflow occurs when the stack is full and the user performs a push operation. Garbage Collection is used to recover the memory occupied by objects that are no longer used.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

Overflow

Crash

Underflow

User flow

Answer explanation

The stack is filled with 5 elements and pushing one more element causes a stack overflow. This results in overwriting memory, code and loss of unsaved work on the computer.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not the application of stack?

A parentheses balancing program

Tracking of local variables at run time

Compiler Syntax Analyzer

Data Transfer between two asynchronous process

Answer explanation

Data transfer between the two asynchronous process uses the queue data structure for synchronisation. The rest are all stack applications.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the usual algorithm for determining whether a sequence of parentheses is balanced. The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(())) ?

1

2

3

4 or more

Answer explanation

In the entire parenthesis balancing method when the incoming token is a left parenthesis it is pushed into stack. A right parenthesis makes pop operation to delete the elements in stack till we get left parenthesis as top most element. 2 left parenthesis are pushed whereas one right parenthesis removes one of left parenthesis. 2 elements are there before right parenthesis which is the maximum number of elements in stack at run time.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of the postfix expression 6 3 2 4 + – *?

1

40

74

-18

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?