Is there a way to convert this recursive algorithm to iterative without using stacks?
public static float T1(int n, float y) {
if (n == 0)
return y;
if (n == 1)
return 1;
return 2 * y * T1(n - 1, y) - T1(n - 2, y);
}
What keeps me confused is having two calls inside the recursion, and I'm not sure how to convert that using loops.