Stacks & Queues

Stacks & Queues

11th Grade

20 Qs

quiz-placeholder

Similar activities

Bloque I Mi marca personal

Bloque I Mi marca personal

5th Grade - University

20 Qs

11° Evaluación bimestral de informática

11° Evaluación bimestral de informática

11th Grade

15 Qs

Acumulativa Período 1

Acumulativa Período 1

8th Grade - University

21 Qs

HTML Quiz

HTML Quiz

9th - 12th Grade

15 Qs

Excel - REFERENCIAS/FORMATO CONDICIONAL/FUNCION SI

Excel - REFERENCIAS/FORMATO CONDICIONAL/FUNCION SI

6th - 12th Grade

20 Qs

Conociendo la Computadora

Conociendo la Computadora

7th Grade - University

20 Qs

CPA MS-Office Hotkeys Quiz

CPA MS-Office Hotkeys Quiz

8th Grade - Professional Development

21 Qs

BTT

BTT

4th - 12th Grade

15 Qs

Stacks & Queues

Stacks & Queues

Assessment

Quiz

Computers

11th Grade

Practice Problem

Hard

Created by

Matt Hunt

Used 34+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?