1/43
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
If the array:
6, 2, 7, 13, 5, 4
is added to a queue, in the order given, which number will be the first number to be removed from the queue?
6
If the implementation of a queue uses the ADT list, which queue operation uses
list.retrieve(1, queueFront);
in its implementation?
getFront()
How is enqueue(newItem) implemented using an ADT list?
list.insert(list.getLength() + 1, newItem);
What operation adds a new item to a queue
enqueue
To initialize a queue that is represented by a circular array, back is set to ______.
MAX_QUEUE - 1
What operation of the ADT stack retrieves and then removes the top of the stack
pop
How many pointers should a link-based implementation of a queue that uses a linear linked chain have? and which ones
two, front and back
What behavior does the ADT stack exhibit?
last-in, first-out
where can items be added in a queue
only at the back of the queue
The ADT queue is value-oriented.
No, the priority queue is
The ADT sorted list inserts and deletes items by their ______.
value
The item that is removed first from a stack is called the what of the stack
the top of the stack
If the array 6, 2, 7, 13, 5, 4 is added to a stack, in the order given, which number will be the first number to be removed from the stack?
4, because a stack uses LIFO
A priority queue orders its items by
priority value
the first item to be removed from a priority queue is the item with
the highest priority value
What is the postfix form of the infix expression: (a + b) * c / d
a b + c * d /
What operation is used to delete something in an ADT list
remove
what operation in the ADT stack is similar to the enqueue operation of the ADT queue
push
Where can items be added in an ADT list
at any position in the list
What can be used to preserve the order of occurrences
a queue
If the array 6, 21, 35, 3, 6, 2, 13 is added to a stack, in the order given, which of the following is the top of the stack?
13
The ______ operation retrieves the item that was added earliest to a queue, but does not remove that item.
getFront
In an array-based implementation of the priority queue, the pqDelete operation returns the item in ______.
Items[size-1]
what does pdDelete do
The getTop operation of the ADT stack changes the stack.
false
The first item to be added to a queue is the first item to be removed from the queue.
true because it uses FIFO
The ADT binary search tree is value-oriented.
true
If a stack is used by an algorithm to check for balanced braces, which of the following is true once the end of the string is reached?
the stack is empty
What type of implementation is an Array-based ADT
linear
If the array
6, 21, 35, 3, 6, 2, 13
is added to a queue, in the order given, which of the following is the back of the queue?
13
the ADT binary tree is position-ortiented
true
If 5 items are added to a stack, the first item to be removed from the stack is the first item that was added to the stack.
false, the last item is the first that would be removed
does getFront change the queue
No, it only returns the item at the front of the queue
What behavior does the ADT queue exhibit?
first in,first out
is pop an ADT queue operation
No it belongs to the ADT stack
what ADT allows yo
Given the language L, where:
L = {w$w’ : w is a possibly empty string of characters other than $, w’ = reverse(w) }
is the string : XYZ$ZXY in L
No because XYZ, should be ZYX
Operations on a queue occur where
both its front and back
What ADT is value oriented
queue
If the implementation of a queue uses the ADT list, which queue operation uses
list.remove(1);
in its implementation?
dequeue()
In a pointer-based implementation of a stack, the stack can grow and shrink dynamically.
true
Operations of the ADT queue can be viewed as general versions of the list and stack operations.