Deck 18: Stacks and Queues

ملء الشاشة (f)
exit full mode
سؤال
A static queue can be implemented as a

A) circular array.
B) stack.
C) dynamic linked list.
D) dynamic vector.
E) None of the above
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A dynamic stack starts as an empty linked list.
سؤال
The STL provides containers for deque and queue.
سؤال
The pop function in the stack template of the STL does not return the value from the top of the stack.
سؤال
A ________ is a double-ended queue.

A) two-headed stack
B) two-tailed vector
C) circular array
D) deque
E) None of the above
سؤال
A ________ stack or queue is implemented using linked lists.

A) dynamic
B) static
C) deque-based
D) floating point
E) None of the above
سؤال
The ________ operation allows an item to be stored on a stack.

A) append
B) add
C) pop
D) push
E) None of the above
سؤال
The statement stack< int, vector > iStack; creates

A) a new stack of integers, implemented as a vector.
B) a new stack of integers, implemented as a deque.
C) a new stack called vector, implemented as integers.
D) a new vector called stack, implemented with integers.
E) None of the above
سؤال
A(n) ________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

A) array
B) queue
C) stack
D) vector
E) None of the above
سؤال
A dynamic stack has a ________ size, and is implemented as a(n) ________.

A) variable, linked list
B) fixed, linked list
C) variable, array
D) fixed, array
E) None of the above
سؤال
For most people, ________ queues are more intuitive and easier to understand than ________ queues.

A) Static, dynamic
B) Dynamic, static
C) Deque-like, stack-like
D) Stack-like, deque-like
E) None of the above
سؤال
A real-world example of the queue data structure can be seen in a stack of cafeteria trays, where the last tray pushed onto the stack is the first tray removed.
سؤال
Static stacks have a ________ size, and are implemented using ________.

A) fixed, linked lists
B) variable, arrays
C) fixed, arrays
D) variable, linked lists
E) None of the above
سؤال
Stacks are useful data structures for algorithms that work with lists of items in a

A) first in, first out order.
B) first in, last out order.
C) last in, last out order.
D) garbage in, garbage out order.
E) None of the above
سؤال
Two primary queue operations are

A) push and pop.
B) enqueue and dequeue.
C) insert and delete.
D) onqueue and offqueue.
E) None of the above
سؤال
The first item placed onto a stack is always the last item removed from the stack.
سؤال
The queue data structure is commonly applied in connection with

A) managing the order of print jobs.
B) communications software.
C) operating systems.
D) All of the above
E) None of the above
سؤال
Enqueue and dequeue are the two most common stack operations.
سؤال
The Standard Template Library offers a stack template that may be implemented as a

A) vector.
B) deque.
C) linked list.
D) All of the above
E) None of the above
سؤال
A ________ is a container that provides quick access to elements at the front and the back of the list.

A) stack
B) queue
C) deque
D) All of the above
E) None of the above
سؤال
A dynamic stack may be implemented as a(n) ________, and expand or shrink with each push or pop operation.

A) array
B) structure
C) linked list
D) A and B
E) None of the above
سؤال
A queue is a data structure that stores and retrieves items in a ________ manner.

A) last in, first out
B) first in, first out
C) first in, last out
D) random
E) None of the above
سؤال
The programmer must declare in advance the size of a dynamic stack or queue.
سؤال
The ________ operation allows an item to be removed from a stack.

A) push
B) pop
C) delete
D) remove
E) None of the above
سؤال
Stacks and queues can be implemented as arrays or linked lists.
سؤال
A stack has two primary operations called

A) push and pull.
B) push and pop.
C) insert and delete.
D) append and delete.
E) None of the above
سؤال
A stack that is implemented as a linked list is known as a deque.
سؤال
In a static stack class, the constructor function can dynamically allocate memory for the stack array.
سؤال
A practical application of the stack data type is

A) the storage of local variables in a function call.
B) the tracking of the order of entry into and exit from nested loops.
C) the tracking of the order of calls and returns of functions in a program.
D) All of the above
E) None of the above
سؤال
A ________ is processed in a manner similar to customers standing in a grocery check-out line: The first customer in line is the first served.

A) stack
B) vector
C) queue
D) All of the above
E) None of the above
سؤال
In a dequeue operation, the element at the ________ of the queue is removed.

A) middle
B) front
C) declaration
D) mid-point
E) None of the above
سؤال
A dynamic queue can be implemented as a

A) dynamic linked list.
B) fixed-length array.
C) fixed-length circular array.
D) All of the above
E) None of the above
سؤال
Queues that are implemented as arrays are called ________ queues.

A) dynamic
B) stack
C) static
D) deque
E) None of the above
سؤال
If information is transmitted faster than it can be processed, it can be held in a ________ while it awaits processing.

A) stack
B) queue
C) static array
D) static deque
E) None of the above
سؤال
Push and pop are the two most common queue operations.
سؤال
When an element is added to a queue, it is added to the rear. When an element is removed, it is removed from the

A) rear.
B) middle.
C) front.
D) All of the above
E) None of the above
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 18: Stacks and Queues
1
A static queue can be implemented as a

A) circular array.
B) stack.
C) dynamic linked list.
D) dynamic vector.
E) None of the above
A
2
A dynamic stack starts as an empty linked list.
True
3
The STL provides containers for deque and queue.
True
4
The pop function in the stack template of the STL does not return the value from the top of the stack.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
5
A ________ is a double-ended queue.

A) two-headed stack
B) two-tailed vector
C) circular array
D) deque
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
6
A ________ stack or queue is implemented using linked lists.

A) dynamic
B) static
C) deque-based
D) floating point
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
7
The ________ operation allows an item to be stored on a stack.

A) append
B) add
C) pop
D) push
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
8
The statement stack< int, vector > iStack; creates

A) a new stack of integers, implemented as a vector.
B) a new stack of integers, implemented as a deque.
C) a new stack called vector, implemented as integers.
D) a new vector called stack, implemented with integers.
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
9
A(n) ________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

A) array
B) queue
C) stack
D) vector
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
10
A dynamic stack has a ________ size, and is implemented as a(n) ________.

A) variable, linked list
B) fixed, linked list
C) variable, array
D) fixed, array
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
11
For most people, ________ queues are more intuitive and easier to understand than ________ queues.

A) Static, dynamic
B) Dynamic, static
C) Deque-like, stack-like
D) Stack-like, deque-like
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
12
A real-world example of the queue data structure can be seen in a stack of cafeteria trays, where the last tray pushed onto the stack is the first tray removed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
13
Static stacks have a ________ size, and are implemented using ________.

A) fixed, linked lists
B) variable, arrays
C) fixed, arrays
D) variable, linked lists
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
14
Stacks are useful data structures for algorithms that work with lists of items in a

A) first in, first out order.
B) first in, last out order.
C) last in, last out order.
D) garbage in, garbage out order.
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
15
Two primary queue operations are

A) push and pop.
B) enqueue and dequeue.
C) insert and delete.
D) onqueue and offqueue.
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
16
The first item placed onto a stack is always the last item removed from the stack.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
17
The queue data structure is commonly applied in connection with

A) managing the order of print jobs.
B) communications software.
C) operating systems.
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
18
Enqueue and dequeue are the two most common stack operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
19
The Standard Template Library offers a stack template that may be implemented as a

A) vector.
B) deque.
C) linked list.
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
20
A ________ is a container that provides quick access to elements at the front and the back of the list.

A) stack
B) queue
C) deque
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
21
A dynamic stack may be implemented as a(n) ________, and expand or shrink with each push or pop operation.

A) array
B) structure
C) linked list
D) A and B
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
22
A queue is a data structure that stores and retrieves items in a ________ manner.

A) last in, first out
B) first in, first out
C) first in, last out
D) random
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
23
The programmer must declare in advance the size of a dynamic stack or queue.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ________ operation allows an item to be removed from a stack.

A) push
B) pop
C) delete
D) remove
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
25
Stacks and queues can be implemented as arrays or linked lists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
26
A stack has two primary operations called

A) push and pull.
B) push and pop.
C) insert and delete.
D) append and delete.
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
27
A stack that is implemented as a linked list is known as a deque.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
28
In a static stack class, the constructor function can dynamically allocate memory for the stack array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
29
A practical application of the stack data type is

A) the storage of local variables in a function call.
B) the tracking of the order of entry into and exit from nested loops.
C) the tracking of the order of calls and returns of functions in a program.
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
30
A ________ is processed in a manner similar to customers standing in a grocery check-out line: The first customer in line is the first served.

A) stack
B) vector
C) queue
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
31
In a dequeue operation, the element at the ________ of the queue is removed.

A) middle
B) front
C) declaration
D) mid-point
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
32
A dynamic queue can be implemented as a

A) dynamic linked list.
B) fixed-length array.
C) fixed-length circular array.
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
33
Queues that are implemented as arrays are called ________ queues.

A) dynamic
B) stack
C) static
D) deque
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
34
If information is transmitted faster than it can be processed, it can be held in a ________ while it awaits processing.

A) stack
B) queue
C) static array
D) static deque
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
35
Push and pop are the two most common queue operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
36
When an element is added to a queue, it is added to the rear. When an element is removed, it is removed from the

A) rear.
B) middle.
C) front.
D) All of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.