Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Java

Posted on 2006-11-03
2
Medium Priority
?
247 Views
Last Modified: 2010-04-16
How do you create a Java Implementing a Queue with a  Singly Linked  List?
0
Comment
Question by:deliachang
2 Comments
 
LVL 4

Expert Comment

by:hclgroup
ID: 17869679
Where is your attempt?
What problems are you encountering?
0
 
LVL 10

Accepted Solution

by:
NetworkArchitek earned 2000 total points
ID: 17869739
Create a Node class then create your Queue class and make it use a LinkedList of Nodes.

A queue has two important operations: enqueue and dequeue. Remember, a Queue works as a FIFO store, First-In-First-Out.

This sounds like homework though so you should try to work through it. It's pretty simple. Remember, in a LinkedList the Node will have 2 data members a Node representing the next node and the actual data object.  Your LinkedList will need to maintain a refernce to the "head" of the list.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Simple Linear Regression
Starting up a Project

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question