
Week 7 - Activity #1 (CC104)
Authored by Jerome Escultura
Other
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the main principle that a stack data structure follows?
First In First Out (FIFO)
Last In First Out (LIFO)
Random Access
First Come First Served
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is NOT an operation typically associated with a stack?
Push
Pop
Peek
Insert At Bottom
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In the context of stacks, what does the push() operation do?
Removes the top element
Adds an element to the bottom
Adds an element to the top
Displays the top element without removing it
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
If a stack follows the LIFO principle, which element will be popped from the following stack [10, 20, 30, 40]?
10
20
30
40
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In which real-life scenario can a stack be used?
Queue at a bank
Browser's back button
Train scheduling system
Internet routing table
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will be the result of calling peek() on an empty stack?
Returns null
Throws an exception
Returns the last element
Does nothing
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the time complexity of the push() operation in a stack implemented with an array?
O(1)
O(n)
O(log n)
O(n²)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?