isEmpty and isFull should be easy. Maintain a variable for the size. Whenever you enqueue, add 1 to that variable. Whenever you dequeue, subtract 1. isEmpty and isFull just depend on the value of that variable. For the actual enqueue operation, maintain the head of the queue as the index 0 and the tail of the queue as the last index. Then check the size variable I previously mentioned.
Example to help you get on the right train of thought for enqueue...
-- starting values --
queue[0] = something, queue size = 1
-- do an enqueue operation for the new element = 2 --
queue[0] = something, queue size = 1, queue[size] = queue[1] = 2
Hopefully that will help you for dequeue as well. Remember that when dequeueing, you need to shift the values in the array one place to the left (if you are using array[0] as the head) and you need to maintain the right queue size.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354