Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

A simple recursion question

Is it considered recursion if there are no parameters passed through the method? I have written a method that successfully solves a problem by calling itself continuously until a solution is reached, but it doesn't take any parameters.

One requirement of the problem is that recursion has to be used so I need to know if this counts. It would seem silly to me if I had to rewrite a successful program because of something technical like this.

Thanks :)
[477 byte] By [srekcus] at [2007-11-11 8:04:15]
# 1 Re: A simple recursion question
Yep. Recursion is just when you call a method inside itself.

public void doSomething() {
// ...
doSomething();
// ...
}
destin at 2007-11-11 22:36:32 >
# 2 Re: A simple recursion question
What work does this method perform if it does not take any parameters? Not very flexible. Is it just acting upon the assumption that the data members are set in the always interesting state?
nspils at 2007-11-11 22:37:37 >