User Profile

Collapse

Profile Sidebar

Collapse
valt
valt
Last Activity: Feb 25 '08, 10:46 PM
Joined: Feb 25 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • valt
    replied to Pointers/Doubly Link lists
    in Java
    Anyway... This is the way i decided to do it... hopefully this works

    Code:
    public class DLLNode
    {
    	String 		Item;
    	int 		Time;
    	DLLNode 	Next;
    	DLLNode 	Prev;
    
    	public DLLNode(String newItem,int newTime,DLLNode newPrev)
    	{
    		Item 			= newItem;
    		Time 			= newTime;
    		Prev		 	= newPrev;
    	}
    	public DLLNode(String newItem,int newTime)
    	{
    ...
    See more | Go to post
    Last edited by valt; Feb 25 '08, 10:34 PM. Reason: Worked

    Leave a comment:


  • valt
    replied to Pointers/Doubly Link lists
    in Java
    I dont see why you need to maintain the reference to the tail at the beginning... as the items grow in the list you should be able to get a reference to a tail later on. You know what im saying? I see these tutorials being made creating two nodes and that just seems foolish to me.

    Thanks for you feedback : ]

    Code:
    Head = new DLLNode(null,null,null,null);
    Also, why isnt this possible in the c...
    See more | Go to post

    Leave a comment:


  • valt
    started a topic Pointers/Doubly Link lists
    in Java

    Pointers/Doubly Link lists

    Code:
    public class DLLNode
    {
    	String 		Item;
    	int 		Time;
    	DLLNode 	Next;
    	DLLNode 	Prev;
    
    	public DLLNode(String newItem,int newTime,DLLNode newNext,DLLNode newPrev)
    	{
    		Item 			= newItem;
    		Time 			= newTime;
    		Next 			= newNext;
    		Prev		 	= newPrev;
    	}
    }
    Code:
    public class DLLList
    {
    	DLLNode Head;
    ...
    See more | Go to post
No activity results to display
Show More
Working...