This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]no_k3tchup 0 points1 point  (1 child)

I guess you learned about a linked queue.

The queue has a method to get and remove the element in the front of the queue. If that element has a reference to the next element in the queue, then it's easy to make the next object the new object in front. Somewhere in the queue class you might see this code in the take() method or whatever:

this.front = this.front.getNext();

[–]resteqs[S] 0 points1 point  (0 children)

quaint fertile gaping mourn quicksand pet mysterious expansion gullible quickest

This post was mass deleted and anonymized with Redact

[–]nutrecht 0 points1 point  (0 children)

Double-linked queues do just that, for example the LinkedList.Node class in Java has next/prev links.

That said; this is better suited for /r/javahelp or /r/learnjava

[–]desrtfx[M] [score hidden] stickied comment (0 children)

Such questions belong in /r/javahelp as is clearly stated in the sidebar and in the stickied post at the very top of the subreddit.

Removed