[SOLVED]
Thanks everyone!
Type: Posts; User: svo
[SOLVED]
Thanks everyone!
Ahhh THanks! That makes WAY more sense. I don't know... The way you bolded them but explained them... It made so much sense. No, I'm not actually writing this code, it's a comprehension question on...
Oh so I followed the logic in your last sentence and it seems to make sense except i couldn't help but notice that when you went through the "return f1( x + 1 ) + x;", you ignored the "+ x" ? is that...
I think I sort of see the logic and kinda-sorta understand it up until the last line of "return f1( x + 1 ) + x;" ... :[
D: @-) I'm a nooobb.... soo... and well, I'm supposed to be able to do this in my head... So I was wondering if I could get some help seeing the logic behind what is happening in the code..
I got this far:
- Return f2(3) is called
- then in the 3 is passed into the f2(int x) right?
- then it's supposed to do the f1( x + 1) + x .... i'm confused about the " + x" ......
Can someone please give me a quick code analysis of what is outputted when the method f1(5) is called?
public in f1( int x )
{
if ( x == 0 )
return 0;
public int multiply( int n )
{
if (n == 0)
return 1;
else if (n % 2 ==1)
public int multiply( int n )
{
if (n == 0)
return 1;
else if (n % 2 ==1)