Question: 1. When implementing a stack on an array, where is a new item added? Select one: a. At index 0 and the rest of the
1. When implementing a stack on an array, where is a new item added?
Select one:
a. At index 0 and the rest of the stack is moved up.
b. The next available slot (index n when there are already n items).
c. The next available slot (index n+1 when there are already n items).
d. The end of the array.
2. When implementing a queue on an array, consider one item already in in the queue. What happens to it when a new item is added or deleted?
Select one:
a. Nothing, it stays in the same index in the array.
b. It moves to a higher array index when items are added.
c. It moves to a higher array index when items are deleted.
d. It moves to a lower array index when items are added.
3.
The term priority in priority queue means that
Select one:
a. the highest priority items are inserted first
b. the programmer must prioritize access to the underlying array
c. the underlying array is sorted by the priority of the items
d. the lowest priority items are deleted first
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
