Results 1 to 2 of 2
Thread: My CS project
- 09-26-2011, 06:57 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 40
- Rep Power
- 0
My CS project
Hey guys I'll be up all night trying to figure this one out but I have plenty of questions that hopefully someone can assist me in.
I'm currently working with Linked Lists and stuff of that sort but some things are still very confusing to me for example
This is my node class. the prev = next = null; doesn't make since. How can I have more than two nodes in my list if this is true?Java Code:public class ListNode<T> { public T element; public ListNode<T> next; public ListNode<T> prev; public ListNode(T ele) { element = ele; prev = next = null; // doesn't make since previous equals next which equals null } }
Well I went ahead and added constructors so it now looks like this (I believe this is right)
Java Code:public class ListNode<T> { public T element; public ListNode<T> next; public ListNode<T> prev; public ListNode(T ele) { element = ele; prev = next = null; } public ListNode(T ele, ListNode<T> n){ element = ele; next = n; } public ListNode(T ele, ListNode<T> p, ListNode<T> n){ element = ele; next = n; prev = p; } }
I would think that is how a node should be set up but please let me know if I am wrong.Last edited by seanfmglobal; 09-26-2011 at 08:06 AM.
- 09-26-2011, 09:53 AM #2
Re: My CS project
Hi. if I understand correctly you want to make linked list structure. So Can you explain what that is structure?
Skype: petrarsentev
http://TrackStudio.com
Similar Threads
-
How to convert from Ant project to maven project?
By jiapei100 in forum New To JavaReplies: 0Last Post: 06-08-2011, 10:01 AM -
Adding a project to an existing project
By Seijuro in forum NetBeansReplies: 4Last Post: 08-08-2010, 10:15 AM -
open existing project project ..
By itaipee in forum EclipseReplies: 1Last Post: 12-28-2008, 08:12 PM -
Could anyone help with project?
By billdara in forum New To JavaReplies: 1Last Post: 03-12-2008, 05:05 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks