Demo entry 6659393

dequeue

   

Submitted by dequeue on Nov 10, 2017 at 22:07
Language: Java. Code size: 308 Bytes.

public T dequeue(){
    //check book solution
    checkInitialization();
    if (isEmpyt())
        throw new EmptyQueueException();
    else{
        T front = queue[frontIndex];
        queue[frontIndex] = null;
        frontIndex = (frontIndex +1) % queue.length
        //see lec notes
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).