Results 1 to 11 of 11
Thread: Single linked lists - help
- 10-29-2009, 03:00 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
-
What do you want it to return as a default if first == null?
- 10-29-2009, 03:04 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
-
- 10-29-2009, 03:09 PM #5
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You are not throwing that exception. Think about the error message you are getting.
Java is smart enough to realize that your if test might return false meaning your if block is never entered. In that case there is nothing to return. But the method says that it returns an Object.
- 10-29-2009, 03:11 PM #6
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
- 10-29-2009, 03:13 PM #7
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
I do not want to open a new topic, so I will ask here. Can you send mi a link to a site with solved exercises about Single linked lists, Double linked lists, stacks, queues, decks, hash tables and maps?
Tnx
- 10-29-2009, 03:34 PM #8
Trail: Collections (The Java™ Tutorials)
Not really solved exercises though.Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 10-29-2009, 03:54 PM #9
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
- 10-29-2009, 04:01 PM #10
I don't know such a site, I've never needed that.
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 10-29-2009, 05:35 PM #11
Member
- Join Date
- Oct 2009
- Posts
- 14
- Rep Power
- 0
I need help again. The next program segment is for adding a first node in a Double linked list:
public void insertFirst(Object o){
DLLNode ins = new DLLNode(o, first, null);//1
if (first == null)
last = ins;
else
first.succ.prev = first;//2
first = ins;
}
Can someone explain me:
what does the line marked with //1 and //2 mean? Possibly with pictures :) I mean, I know what they mean but I can't see how that adds node in the list.
Similar Threads
-
Problem sending linked lists
By deepthought015 in forum NetworkingReplies: 1Last Post: 04-26-2009, 12:47 PM -
Sending linked lists via sockets
By deepthought015 in forum NetworkingReplies: 1Last Post: 04-26-2009, 02:33 AM -
Doubly Linked Lists
By stevenson15 in forum New To JavaReplies: 6Last Post: 04-21-2009, 12:35 PM -
Single and Multi Selection Lists
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 08:03 PM -
question about linked lists
By jkurth in forum Advanced JavaReplies: 1Last Post: 11-11-2007, 08:33 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks