Solved

Java

Posted on 2006-11-03
2
223 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
Comment Utility
Where is your attempt?
What problems are you encountering?
0
 
LVL 10

Accepted Solution

by:
NetworkArchitek earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now