Deck 5: Queues
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/28
العب
ملء الشاشة (f)
Deck 5: Queues
1
Which of the following operations of a queue examines the element at the front of the queue?
A) Enqueue
B) isEmpty
C) size
D) first
A) Enqueue
B) isEmpty
C) size
D) first
first
2
What is the principle difference in behavior between a stack and a queue?
A) a stack reverses order whereas a queue preserves order
B) a stack does nothing whereas a queue can preserve and reverse order
C) there is no difference
D) a stack preserves order whereas a queue reverses order
A) a stack reverses order whereas a queue preserves order
B) a stack does nothing whereas a queue can preserve and reverse order
C) there is no difference
D) a stack preserves order whereas a queue reverses order
a stack reverses order whereas a queue preserves order
3
Queues operate as _______________.
A) Last Out, First In
B) First In, First Out
C) Last In, First Out
D) None of the above
A) Last Out, First In
B) First In, First Out
C) Last In, First Out
D) None of the above
First In, First Out
4
A ______ can be used to preserve the order of a set of data.
A) Queue
B) Stack
C) Software
D) Heaps
A) Queue
B) Stack
C) Software
D) Heaps
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
5
To add an element to a queue you use the____________________ method.
A) push
B) enqueue
C) dequeue
D) pop
A) push
B) enqueue
C) dequeue
D) pop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
6
The shifting of elements in a noncircular array implementation creates an _______ complexity.
A) O(1)
B) O(n)
C) O(nlogn)
D) O(logn)
A) O(1)
B) O(n)
C) O(nlogn)
D) O(logn)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
7
A linked implementation of a queue is facilitated by references to the ______ and ______ elements of the linked list.
A) First, second
B) First, middle
C) Middle, last
D) First, last
A) First, second
B) First, middle
C) Middle, last
D) First, last
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
8
When an element is removed from a queue using the dequeue operation, that element is removed from the ____________ of the collection.
A) Front
B) Rear
C) Middle
D) None of the above
A) Front
B) Rear
C) Middle
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
9
When an element is added to a queue using the enqueue operation, that element is added to the ____________ of the collection.
A) Front
B) Rear
C) Middle
D) None of the above
A) Front
B) Rear
C) Middle
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
10
A circular array implementation of a queue is more efficient than a fixed array implementation of a queue because elements never have to be ___________.
A) added
B) removed
C) shifted
D) initialized
A) added
B) removed
C) shifted
D) initialized
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
11
If you were to place elements on a collection and then wanted to preserve the order, would it be better to use a Stack or a______?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
12
What are the 3 primary methods for a queue?______
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
13
A ______ is a linear collection whose elements are added on one end and removed from the other.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
14
Simulations are often implemented using ______ to represent waiting lines.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
15
The enqueue and dequeue operations work on ______ ends of the collection.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
16
When one enqueue's an element to a queue, you add that element to the ____ of the queue.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
17
When utilizing a circular array for a queue, complete the line of code that updates the value of rear to wrap around the end of the array to the front?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
18
A ______ implementation of a queue is the preferable array implementation because it does not require elements to be shifted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
19
The enqueue and dequeue operations work on opposite ends of the collection.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
20
The first operation removes an element at the front of the queue and returns a reference to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
21
Queue elements are processed in a FIFO manner-the first element in is the first element out.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
22
Because queue operations modify both ends of the collection, fixing one end at index 0 eliminates the requirement that elements be shifted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
23
Treating arrays as circular eliminates the need to shift elements in an array queue implementation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
24
What are some of the other operations that might be implemented for a queue?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
25
Is it possible for the front and rear references in a linked implementation to be equal?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
26
Is it possible for the front and rear references in a circular array implementation to be equal?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which implementation has the worst time complexity?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which implementation has the worst space complexity?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 28 في هذه المجموعة.
فتح الحزمة
k this deck