This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Please Help! recursive call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Please Help! recursive call" Watch "Please Help! recursive call" New topic
Author

Please Help! recursive call

pot tom
Greenhorn

Joined: Apr 27, 2007
Posts: 3
Sorry for posting here, badly I need help from expert like you!

Can any one explain why my codes does works properly, I mean result what I am suppose to get, it not getting through this method. This is just two method. from my class "MainClass.java".



That was the difference method which will take two list head1, head2

lets say: head1 lis: 3 ; 6 ; 9 ; 10
head2 list is: 5; 6; 10

Answer should be: 3->9, can any one correct me!

Here is another method:



lets say: head1 lis: 3 -> 6 -> 9 -> 10
head2 list is: 5-> 6-> 10

Answer should be: 3,5,6,9,10, can any one correct me!




Note that IntNode class contain:



This is how I was trying to test:



seems like program output partly not what I am expecting result.
[ April 27, 2007: Message edited by: pot tom ]
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11249
    
  16

It would help if you would use the code tags. When entering your formatted code, hi-lite the code block, then press that "code" button you see below under the "Instant UBB Code". Then, when displayed, it's MUCH easier to read.

Second, what exactly do you mean by "it doesn't run"? Does it error out? does it seem to go into an infinite loop? Does it even compile?

The more details you can give on the exact nature of your problem, the easier it is to help.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
pot tom
Greenhorn

Joined: Apr 27, 2007
Posts: 3
I have modified the code, can anyone please help me.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38441
    
  23
What is your program doing, what is it supposed to do, and what is the logic behind it?
 
 
subject: Please Help! recursive call