
Stack Queue

Quiz
•
Computers
•
Professional Development
•
Medium
Gulzina Nagibova
Used 2+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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. If stack is empty, dispaly error and return/halt
2. Check if the stack is empty
3. Decrement stack_pointer by one
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
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
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
Similar Resources on Wayground
10 questions
Chapter 2 - FSW

Quiz
•
Professional Development
10 questions
Collections MQC

Quiz
•
Professional Development
10 questions
Drone Ecosystem Day 2

Quiz
•
3rd Grade - Professio...
10 questions
QUiz e

Quiz
•
Professional Development
10 questions
TECNO MOBILE

Quiz
•
Professional Development
10 questions
PM JFE 2.0 - conditionals, operators, arrays and loops

Quiz
•
Professional Development
10 questions
last

Quiz
•
Professional Development
10 questions
Kuis 19122023

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade