//public boolean isempty(/true if queue is empty return rear+ ==front |(front+maxsize- ==rear)//public boolean isfull(/true if queue is full return rear+ ==front |(front+maxsize- ==rear)//public int size(/(assumes queue not emptyif(rear >front/contiguous sequence return rear-front+ else /broken sequence return (maxsize-front(rear+ )///end class queue notice the complexity of the isfull()isempty()and size(methods this nocount approach is seldom needed in practiceso we'll refrain from discussing it in detail efficiency of queues as with stackitems can be inserted and removed from queue in ( time deques deque is double-ended queue you can insert items at either end and delete them from either end the methods might be called insertleft(and insertright()and removeleft(and removeright(if you restrict yourself to insertleft(and removeleft((or their equivalents on the right)then the deque acts like stack if you restrict yourself to insertleft(and removeright((or the opposite pair)then it acts like queue deque provides more versatile data structure than either stack or queueand is sometimes used in container class libraries to serve both purposes howeverit' not used as often as stacks and queuesso we won' explore it further here priority queues priority queue is more specialized data structure than stack or queue however