
Stack Queue
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Medium
Gulzina Nagibova
Used 2+ times
FREE Resource
Enhance your content in a minute
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
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
8 questions
introduction to visual programming
Quiz
•
Professional Development
10 questions
Jr Papua
Quiz
•
Professional Development
10 questions
Day 1
Quiz
•
Professional Development
10 questions
HND Computing Unit 17 Network Infrastructure Security
Quiz
•
University - Professi...
10 questions
Roblox
Quiz
•
Professional Development
10 questions
SQL Select 1
Quiz
•
Professional Development
10 questions
PreTrainingClassesObjectsMethods
Quiz
•
Professional Development
10 questions
e-commerce security TRUE/FALSE Quiz
Quiz
•
University - Professi...
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
