Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java

Posted on 2006-11-03
2
Medium Priority
?
243 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 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

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.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

719 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