Deck 18: Stacks and Queues

Full screen (f)
exit full mode
Question
In a dequeue operation, the element at the of the queue is removed.

A)declaration
B)middle
C)front
D)mid- point
E)None of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
Two primary queue operations are

A)push and pop.
B)insert and delete.
C)onqueue and offqueue.
D)enqueue and dequeue.
E)None of the above
Question
If information is transmitted faster than it can be processed, it can be held in a while it awaits processing.

A)static deque
B)queue
C)static array
D)stack
E)None of the above
Question
A dynamic stack may be implemented as a(n), and expand or shrink with each push or pop operation.

A)linked list
B)structure
C)array
D)A and B
E)None of the above
Question
A is a container that provides quick access to elements at the front and the back of the list.

A)queue
B)stack
C)deque
D)All of the above
E)None of the above
Question
The queue data structure is commonly applied in connection with

A)communications software.
B)operating systems.
C)managing the order of print jobs.
D)All of the above
E)None of the above
Question
Queues that are implemented as arrays are called queues.

A)static
B)stack
C)dynamic
D)deque
E)None of the above
Question
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)vector
B)stack
C)queue
D)All of the above
E)None of the above
Question
For most people, _ queues are more intuitive and easier to understand than _ queues.

A)Deque- like, stack- like
B)Static, dynamic
C)Stack- like, deque- like
D)Dynamic, static
E)None of the above
Question
The operation allows an item to be stored on a stack.

A)add
B)append
C)pop
D)push
E)None of the above
Question
A queue is a data structure that stores and retrieves items in a manner.

A)random
B)last in, first out
C)first in, first out
D)first in, last out
E)None of the above
Question
A static queue can be implemented as a

A)circular array.
B)stack.
C)dynamic vector.
D)dynamic linked list.
E)None of the above
Question
The Standard Template Library offers a stack template that may be implemented as a

A)deque.
B)linked list.
C)vector.
D)All of the above
E)None of the above
Question
Static stacks have a size, and are implemented using _ .

A)fixed, linked lists
B)variable, linked lists
C)variable, arrays
D)fixed, arrays
E)None of the above
Question
A dynamic stack has a size, and is implemented as a(n).

A)variable, linked list
B)fixed, array
C)variable, array
D)fixed, linked list
E)None of the above
Question
The operation allows an item to be removed from a stack.

A)push
B)delete
C)remove
D)pop
E)None of the above
Question
A(n)is an abstract data type that stores and retrieves items in a last- in- first- out manner.

A)stack
B)array
C)vector
D)queue
E)None of the above
Question
Stacks are useful data structures for algorithms that work with lists of items in a

A)last in, last out order.
B)first in, first out order.
C)garbage in, garbage out order.
D)first in, last out order.
E)None of the above
Question
A stack or queue is implemented using linked lists.

A)static
B)dynamic
C)deque- based
D)floating point
E)None of the above
Question
A practical application of the stack data type is

A)the tracking of the order of calls and returns of functions in a program.
B)the tracking of the order of entry into and exit from nested loops.
C)the storage of local variables in a function call.
D)All of the above
E)None of the above
Question
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.
Question
The first item placed onto a stack is always the last item removed from the stack.
Question
The STL provides containers for deque and queue.
Question
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)middle.
B)front.
C)rear.
D)All of the above
E)None of the above
Question
A dynamic stack starts as an empty linked list.
Question
Enqueue and dequeue are the two most common stack operations.
Question
A stack has two primary operations called

A)insert and delete.
B)push and pull.
C)append and delete.
D)push and pop.
E)None of the above
Question
The statement stack< int, vector > iStack; creates

A)a new stack of integers, implemented as a deque.
B)a new stack called vector, implemented as integers.
C)a new vector called stack, implemented with integers.
D)a new stack of integers, implemented as a vector.
E)None of the above
Question
A _ is a double- ended queue.

A)two- tailed vector
B)deque
C)circular array
D)two- headed stack
E)None of the above
Question
A stack that is implemented as a linked list is known as a deque.
Question
Stacks and queues can be implemented as arrays or linked lists.
Question
A dynamic queue can be implemented as a

A)fixed- length array.
B)dynamic linked list.
C)fixed- length circular array.
D)All of the above
E)None of the above
Question
In a static stack class, the constructor function can dynamically allocate memory for the stack array.
Question
The pop function in the stack template of the STL does not return the value from the top of the stack.
Question
Push and pop are the two most common queue operations.
Question
The programmer must declare in advance the size of a dynamic stack or queue.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 18: Stacks and Queues
1
In a dequeue operation, the element at the of the queue is removed.

A)declaration
B)middle
C)front
D)mid- point
E)None of the above
C
2
Two primary queue operations are

A)push and pop.
B)insert and delete.
C)onqueue and offqueue.
D)enqueue and dequeue.
E)None of the above
D
3
If information is transmitted faster than it can be processed, it can be held in a while it awaits processing.

A)static deque
B)queue
C)static array
D)stack
E)None of the above
B
4
A dynamic stack may be implemented as a(n), and expand or shrink with each push or pop operation.

A)linked list
B)structure
C)array
D)A and B
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
5
A is a container that provides quick access to elements at the front and the back of the list.

A)queue
B)stack
C)deque
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
6
The queue data structure is commonly applied in connection with

A)communications software.
B)operating systems.
C)managing the order of print jobs.
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
7
Queues that are implemented as arrays are called queues.

A)static
B)stack
C)dynamic
D)deque
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
8
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)vector
B)stack
C)queue
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
9
For most people, _ queues are more intuitive and easier to understand than _ queues.

A)Deque- like, stack- like
B)Static, dynamic
C)Stack- like, deque- like
D)Dynamic, static
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
10
The operation allows an item to be stored on a stack.

A)add
B)append
C)pop
D)push
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
11
A queue is a data structure that stores and retrieves items in a manner.

A)random
B)last in, first out
C)first in, first out
D)first in, last out
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
12
A static queue can be implemented as a

A)circular array.
B)stack.
C)dynamic vector.
D)dynamic linked list.
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
13
The Standard Template Library offers a stack template that may be implemented as a

A)deque.
B)linked list.
C)vector.
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
14
Static stacks have a size, and are implemented using _ .

A)fixed, linked lists
B)variable, linked lists
C)variable, arrays
D)fixed, arrays
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
15
A dynamic stack has a size, and is implemented as a(n).

A)variable, linked list
B)fixed, array
C)variable, array
D)fixed, linked list
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
16
The operation allows an item to be removed from a stack.

A)push
B)delete
C)remove
D)pop
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
17
A(n)is an abstract data type that stores and retrieves items in a last- in- first- out manner.

A)stack
B)array
C)vector
D)queue
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
18
Stacks are useful data structures for algorithms that work with lists of items in a

A)last in, last out order.
B)first in, first out order.
C)garbage in, garbage out order.
D)first in, last out order.
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
19
A stack or queue is implemented using linked lists.

A)static
B)dynamic
C)deque- based
D)floating point
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
20
A practical application of the stack data type is

A)the tracking of the order of calls and returns of functions in a program.
B)the tracking of the order of entry into and exit from nested loops.
C)the storage of local variables in a function call.
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
21
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.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
22
The first item placed onto a stack is always the last item removed from the stack.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
23
The STL provides containers for deque and queue.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
24
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)middle.
B)front.
C)rear.
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
25
A dynamic stack starts as an empty linked list.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
26
Enqueue and dequeue are the two most common stack operations.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
27
A stack has two primary operations called

A)insert and delete.
B)push and pull.
C)append and delete.
D)push and pop.
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
28
The statement stack< int, vector > iStack; creates

A)a new stack of integers, implemented as a deque.
B)a new stack called vector, implemented as integers.
C)a new vector called stack, implemented with integers.
D)a new stack of integers, implemented as a vector.
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
29
A _ is a double- ended queue.

A)two- tailed vector
B)deque
C)circular array
D)two- headed stack
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
30
A stack that is implemented as a linked list is known as a deque.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
31
Stacks and queues can be implemented as arrays or linked lists.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
32
A dynamic queue can be implemented as a

A)fixed- length array.
B)dynamic linked list.
C)fixed- length circular array.
D)All of the above
E)None of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
33
In a static stack class, the constructor function can dynamically allocate memory for the stack array.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
34
The pop function in the stack template of the STL does not return the value from the top of the stack.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
35
Push and pop are the two most common queue operations.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
36
The programmer must declare in advance the size of a dynamic stack or queue.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 36 flashcards in this deck.