Overflow & Underflow
How do I define Empty / Full?
- Both are defined by q.front = q.rear
How could we solve this?
- Sacrifice one element in the array by initialising size to size -1
- then increment before adding an element,
if q.rear = q.front -> can’t add the element
- test for remove happened before front is updated.