Font size
WorksheetsSTACK DATA STRUCTURE
Total questions: 45
Worksheet time: 34mins
Stacks have LIFO ordering
TRUE
FALSE
LIFO stands for
List of Outputs
Last in First Out
First in Last Out
None of them
Act of adding values into a stack is called
Popping
Polling
Pushing
None
Which of the following statement(s) about stack data structure is/are NOT correct?
Stack data structure can be implemented using linked list
New node can only be added at the top of the stack
Stack is the FIFO data structure
The last node at the bottom of the stack has a NULL link
If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
A
B
C
D
E
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?
Underflow occurs
Stack operations are performed smoothly
Overflow occurs
None of the above
Which of the following is not an inherent application of stack?
Implementation of recursion
Evaluation of a postfix expression
Job scheduling
Reverse a string
In the stack process of inserting an element in the stack is called as _____________________
Create
Evaluation
Push
Pop
Process of Removing element from the stack is called as __________.
Pop
Push
Create
Postfix
In the stack, If user try to remove element from the empty stack then it called as ___________.
Overflow of Stack
Empty Collection
Underflow of Stack
Garbage Collection
User push 1 element in the stack having already five elements and having stack size as 5 then stack becomes ___________.
Overflow
User Flow
Underflow
Crash
In order to keep track of current topmost element of the stack we need to maintain one variable.
Yes
No
Both Yes and No
None of the answer
Select a real life situation implement stack
All of the answers
The cars a garage the first car in will be the last car out of the garage
The batteries in a flashlight
The person wear bangles
Stacks have LIFO ordering
TRUE
FALSE
Act of adding values into a stack is called
Popping
Pushing
Polling
None
Which of the following statement(s) about stack data structure is/are NOT correct?
Stack data structure can be implemented using linked list
New node can only be added at the top of the stack
The last node at the bottom of the stack has a NULL link
HIDE ANSWER
Stack is the FIFO data structure
A stack is a data structure in which elements?
Can be added to any position and removed only from the top
Can be only added to the top and removed from any position
Can be added and removed from the top only
Can be added and removed from any position
Only top element can be accessed in stack?
TRUE
FALSE
MAYBE
SOMETIMES
What is a stack?
A data structure that removes the first added data item.
A data structure that increases data items first.
Data structure that removes the last added data item first
A data structure that multiplies data items
What two operations do stacks require?
Push
Draw
Stretch
Drag
Pop
If you have a stack containing 'A' 'D' 'G' . What will happen if you push 'C' into the stack?
'C' Will be added on top of the stack
'C' Will be added from the bottom of the stack
'C' Will be removed from the stack
'C' Will not be added to the stack
A stack containing 'Dog' 'Cat' & 'Rat' . What will happen if you carry out a pop operation on the stack ?
Stack overflow
Cat will be removed
Dog will be removed
Rat will be removed
If you carry out a pop operation on this stack what will you be left with?
What will happen if you carry out a push operation with the word 'Bill'?
What are Stacks Used For?
Type in data from keyboard
To remove data
To stack information
To keep track of a sequence of operations
When an interrupt occurs, where is the current instruction placed in the stack?
On top
The bottom
The side
No where
The general principle of stack is
When do pop, top element is removed
First in and first out
Use push to remove element
Use pop to insert element
The general principle of stack is:
Use pop to insert element
Use push to remove element
First in and first out
When do push, the element is inserted at the top
When you want to remove in a stack, you remove the topmost item first.
True
False
A very simple illustration of a stack is a pile of books wherein you can add a book at the bottom.
True
False
The stack overflow condition occurs when we try to insert elements in an empty stack.
True
False
The underflow condition occurs when we try to remove elements from a full stack.
True
False
The push operation is the process of adding new elements in the stack.
True
False
The pop operation is the process of removing elements from a stack.
True
False
Peek is an operation that returns the value of the topmost element of the stack.
True
False
Stacks can be represented using arrays or using a linked list data structures.
True
False
One of the applications of the stack is polish and reverse polish notations.
True
False
The three basic operations that can be performed on the stacks are push, pop, and peek operations.
True
False
What is a data structure where the last item added is the first item removed?
Stack
Queue
Tree
Hash Table
Example of linear data structure except
array
tree
queue
stack
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?
Underflow occurs
Stack operations are performed smoothly
Overflow occurs
None of the above
If the sequence of operations - push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values
2,2,1,1,2
2,2,1,2,2
2,1,2,2,1
2,1,2,2,2
