• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Please Help! recursive call

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pot tom
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have modified the code, can anyone please help me.
 
Marshal
Posts: 79703
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your program doing, what is it supposed to do, and what is the logic behind it?
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic