Results 1 to 1 of 1
Thread: Linked List node class help!!
- 05-03-2010, 01:21 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 31
- Rep Power
- 0
Linked List node class help!!
My instructor gave us an assignment that is supposed to support a Linked List that has two different trails of references. If you follow one trail of references it gives you the int values of the list in the order they were added and the other trail gives you the int values of the list in numeric order. I am supposed to just create a node class that will support the list, not create the list. Does this class do that or do I need more/different methods?
Java Code:public class tlf0096DualNode { private tlf0096DualNode link, sortLink; private String data; public tlf0096DualNode(){ data = null; link = null; sortLink = null; }//end constructor public tlf0096DualNode(String newData, tlf0096DualNode linkValue){ data = newData; link = linkValue; sortLink = null; }//end method public void setData(String newData){ data = newData; }//end method public String getData(){ return data; }//end method public void setLink(tlf0096DualNode newLink){ link = newLink; }//end method public void setSortLink(tlf0096DualNode newLink){ sortLink = newLink; } public tlf0096DualNode getLink(){ return link; }//end method public tlf0096DualNode getSortLink(){ return sortLink; } }//end class
Similar Threads
-
Linked list inside a linked list
By viperlasson in forum New To JavaReplies: 5Last Post: 07-26-2010, 11:15 PM -
Need help using the Linked List class
By wlc in forum New To JavaReplies: 1Last Post: 08-13-2009, 03:38 AM -
How to link a Array elemant to a Linked list Node
By ravinda in forum New To JavaReplies: 2Last Post: 04-18-2009, 09:16 AM -
Linked List integer list
By igniteflow in forum Advanced JavaReplies: 1Last Post: 12-10-2008, 08:53 PM -
Linked List help
By neobie in forum New To JavaReplies: 8Last Post: 12-22-2007, 03:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks