chap listsstacksand queues /linked queue implementation class lqueue implements queue private link front/pointer to front queue node private link rear/pointer to rear queuenode int size/number of elements in queue /constructors public lqueue(init()public lqueue(int sizeinit()/ignore size private void init(/initialize queue front rear new link(null)size public void clear(init()/reinitialize queue public void enqueue( it/put element on rear rear setnext(new link(itnull))rear rear next()size++public dequeue(/remove element from front assert size ! "queue is empty" it front next(element()/store dequeued value front setnext(front next(next())/advance front if (front next(=nullrear front/last object size--return it/return object public frontvalue(/get front element assert size ! "queue is empty"return front next(element()public int length(return size/return length figure linked queue class implementation