
Stacks & Queues
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Matt Hunt
Used 34+ times
FREE Resource
Enhance your content in a minute
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'
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?
Similar Resources on Wayground
15 questions
Data structures 2: Stacks and Queues
Quiz
•
11th Grade
20 questions
Struktur Data
Quiz
•
9th - 12th Grade
20 questions
INTRODUCCIÓN A LOS ALGORITMOS
Quiz
•
9th - 12th Grade
15 questions
AIJ KD 3.1
Quiz
•
11th Grade
20 questions
Nuevas tecnologías
Quiz
•
6th Grade - Professio...
20 questions
Logic Gates
Quiz
•
9th - 12th Grade
20 questions
Unit-1 Computational Thinking
Quiz
•
9th - 12th Grade
15 questions
Media codes
Quiz
•
11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
