Given a circular array implementation of a queue in this state:

with queue.length as 7, you are to finish the trace of
ensureCapacity().
What are the values of frontIndex and backIndex after the call is complete?
|
queue |
oldQueue |
oldSize |
newSize | frontIndex | backIndex |
|
x,5,7,7,1,3,2 |
x,5,7,7,1,3,2 |
7 | 14 | 1 | 6 |
|
x, x, x, x, x, x, x, x, x, x, x, x, x, x |
|||||
|
5, x, x, x, x, x, x, x, x, x, x, x, x, x |
2 | ||||
|
5, 7, x, x, x, x, x, x, x, x, x, x, x, x |
3 | ||||
| .... |
There are no hints for this question