ok, I narrowed down, and now I know which part is that I don't understand. I modified the method a bit, so bare with me. Take a look at the output and explain why when n = 5 it prints 5; however,...
Type: Posts; User: mia_tech
ok, I narrowed down, and now I know which part is that I don't understand. I modified the method a bit, so bare with me. Take a look at the output and explain why when n = 5 it prints 5; however,...
look at the code there's not "else if"... there's a nested "if, else" statement. So what you're telling me is that once (n % m == 0) it calls these two recursive method before starting all over...
if n = 5 it enters the first if prints the number and it would exit the recursion, I still don't see how would print the 2's
ok, I'm almost there... but why when it reaches 5 and 4 skips this part
System.out.println("n " + n + " m " + m);
System.out.println("m " + m + " m-1 " + (m-1));
primeFactorsR(m, m-1);
and...
yes, I did that, but I'm having problem knowing when this call "primeFactorsR(n/m, (n/m)-1)" takes place.
ones it gets here "primeFactorsR(m, m-1)" it will enter the next recursion or it will...
guys, is there any way to trace the variables and calls in netbeans for recursive methods? I'm trying to understand the behavior of the "primeFactorsR" recursive method, but I'm kind of confuse
...