Stacks & Queues

Stacks & Queues

11th Grade

20 Qs

quiz-placeholder

Similar activities

Topic 3 (Stacks)

Topic 3 (Stacks)

1st - 12th Grade

20 Qs

Assesmen Kognitif (XI)

Assesmen Kognitif (XI)

11th Grade - University

15 Qs

Year 12 Programming

Year 12 Programming

11th - 12th Grade

15 Qs

Вспомнить всё

Вспомнить всё

9th - 12th Grade

17 Qs

Understanding Stacks and Queues

Understanding Stacks and Queues

11th Grade

15 Qs

Y13 Graph Traversal

Y13 Graph Traversal

9th Grade - University

16 Qs

Kuis Stack dan Queue

Kuis Stack dan Queue

9th - 12th Grade

25 Qs

Java Data Structures

Java Data Structures

11th - 12th Grade

24 Qs

Stacks & Queues

Stacks & Queues

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Matt Hunt

Used 33+ 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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?