Question:
Program how an item is removed from a circular queue
Author: Will ParkerAnswer:
If (!Empty()) { string r = QueueArray[front]; QueueArray[front] = ""; front = (front + 1) % capacity; count--; return r; } else { throw new InvalidOperationException("Invalid operation. The queue is empty."); } Removing at item removes the first item. You don’t search for it
0 / 5 (0 ratings)
1 answer(s) in total