Assume that you are implementing a simple array-based class NumQueue . It has two integer values front and rear for storing the front index and rear index of the queue and another integer variable size for storing the queue size. While inserting values you find that even if the array is full at the end, there might be empty cells at the front, since items have been removed. How would you ensure that, if the queue is full at the rear end, it will wrap the rear marker to the opposite end for the insertion of new elements?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here