0

I have n!/((n-r)!r!)

which I figured out how to make recursive:

int crn (int n, int r)
{
	if (r==0||r==n)
		return 1;
	return (n-1)+(n-1,r-1);
}

how do I make it non-recursive?

Edited by Nick Evan: Added code-tags

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Agni
0

I have n!/((n-r)!r!)

which I figured out how to make recursive:

int crn (int n, int r)
{
	if (r==0||r==n)
		return 1;
	return (n-1)+(n-1,r-1);
}

how do I make it non-recursive?

what is this?? This is not a program, nor is it a recursive function and it does not calculate factorial. Did you even read this before posting it?

Edited by Agni: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.