Solved

Java

Posted on 2006-11-03
2
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

624 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