Stack Queue

Stack Queue

Professional Development

5 Qs

quiz-placeholder

Similar activities

Mobile Technology

Mobile Technology

Professional Development

10 Qs

python quiz

python quiz

6th Grade - Professional Development

10 Qs

Scratch

Scratch

KG - Professional Development

10 Qs

RE-ECHO ON TECHNOLOGY LITERACY AND SKILLS

RE-ECHO ON TECHNOLOGY LITERACY AND SKILLS

Professional Development

10 Qs

LCD vs LED vs OLED

LCD vs LED vs OLED

KG - Professional Development

10 Qs

XPS 13 9300 Training Study

XPS 13 9300 Training Study

Professional Development

10 Qs

E Business Strategy

E Business Strategy

Professional Development

10 Qs

USE OF ICT IN THE LEARNING PROCESS

USE OF ICT IN THE LEARNING PROCESS

Professional Development

10 Qs

Stack Queue

Stack Queue

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Gulzina Nagibova

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

pop, push 59, pop, push 91, pop, peek, pop, push 1

push 1, pop, push 59, pop, push 91, pop, peek, pop, push 17

peek, push 59, pop, push 91, pop, pop, push 1

peek, pop, pop, pop, push 1, push 59, pop, push 19, peek

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The following statements, in structured English, form the algorithm for the pop operation on a stack. Find the correct order.

  1. 1. If stack is empty, dispaly error and return/halt

  2. 2. Check if the stack is empty

  3. 3. Decrement stack_pointer by one

  4. 4. Else return the data item indexed by stack_pointer

1,2,3,4

2,1,4,3

3,2,1,4

3,1,4,2

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The following diagram is an abstraction of a stack. The stack currently contains three items (names). The pointer to the top of the stack is shown in pink.

The following operations are carried out in the order given:

  • push Harry

  • pop

  • push Luna

  • peek

  • pop

  • pop

To which position will the top pointer point after all the operations have been carried out?

0

2

1

3

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The following diagram is an abstraction of a queue. The queue will be implemented using a static array and circular queue methods are used to make efficient use of space.
The front pointer (black) points to the start of the queue. The rear pointer (pink) points to the end of the queue.

Dan is at the front of the queue in position 0. A series of operations occur as follows:

  • enqueue Nigel,

  • enqueue Anil,

  • enqueue Sasham,

  • dequeue,

  • enqueue Jordan,

  • dequeue,

  • enqueue Aayna,

  • enqueue Germaine,

  • dequeue,

  • dequeue,

  • enqueue Tom,

  • enqueue Ben,

  • dequeue,

  • enqueue Amar


To which position will front point after all the operations have been carried out?

4

6

5

0

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Sam wants to make sure that everyone gets a piece of the festive cake before they go for seconds. The cake has 15 pieces and his friends are Brandon, Millie, Dorris, Adele, Robin, and Joe.

He uses a linear queue to manage cake requests. When a person is given a piece of cake they are enqueued. When a person has eaten their piece of cake and are ready for another one, they are dequeued.

The following diagram is an abstraction of a linear queue that is used to represent the slices of cake. At the moment, the queue is empty. The front pointer (the black knife) points to the start of the queue. The rear pointer (the orange fork) points to the end of the queue. Each piece of cake is in a specific position in the queue and the first piece is in position 0.

To which position will front point after Brandon and Millie have finished their first piece of cake and are having seconds, but all of the other people are still eating their first piece?

2

4

6

8

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?