
Stacks & Queues

Quiz
•
Computers
•
11th Grade
•
Hard
Matt Hunt
Used 34+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What method is used to return the top of the stack?
remove (element)
pop()
pop (position)
peek()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A stack is implemented in Python using the built-in list data structure. What Python method is used to implement push() function?
insert()
append()
add()
delete()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A stack is implemented in Python using the built-in list data structure. Complete this code of function size() within the Stack class.
class Stack:
def __init__(self):
self.items = [ ]
def size(self):
…………………
return len(self.items)
stack.length
return len(stack)
return length(self.items)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A stack is implemented in Python using the built-in list data structure. Complete this code of function peek() within the Stack class.
class Stack:
def __init__(self):
self.items = [ ]
def peek(self):
…………………
return self.items[len(self.items)]
return self.items[stack.length]
return self.items[stack.length-1]
return self.items[len(self.items)-1]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following operations are performed on a Stack.
s=Stack()
s.push(‘a’)
s.push(‘b’)
s.pop()
s.push(‘c’)
s.peek()
What is the top of the Stack s when these operations are complete?
'a'
'b'
'c'
Stack is empty
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following operations are performed on a Stack.
s=Stack()
s.push(‘a’)
s.push(‘b’)
s.push(‘c’)
while not s.isEmpty():
s.pop()
s.pop()
What is the top of the Stack s when these operations are complete?
'a'
'b'
Empty stack
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
stack colours=(‘Red’, ‘Green’, ‘Blue’)
What is the value of top of the stack colours?
-1
'Red'
'Green'
'Blue'
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
AP CS PRINCIPLES GENERAL

Quiz
•
11th Grade
15 questions
Windows Printing & 3D Printing

Quiz
•
9th - 12th Grade
20 questions
Remedial SAS Informatika Fase D Kelas 7

Quiz
•
7th Grade - University
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
21 questions
Data Structures

Quiz
•
9th - 12th Grade
15 questions
INFORMATIKA 10 SMT 1 PTS HAL 025

Quiz
•
9th - 12th Grade
25 questions
ATS Gasal-X TO 1

Quiz
•
10th Grade - University
20 questions
Fornite

Quiz
•
1st - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade