i miss type recursion it is iterative algo but recursion can be use.
On Sat, Mar 3, 2012 at 6:29 PM, amrit harry <[email protected]> wrote:
> use recursion
> c[1][1]=1;
> c[2][1]=1;
> c[2][2]=1;
> for(i=0;i<n;i++)
>
> for(j=0;(2*i)-1;j++)
> {
> c[i][j]=(c[i-1][j]+c[i-1][j+1])
> if(c[i][j]>P)
> c[i][j]-=P;//dont use module because it is slow we know the value never
> exceede 2*P because we are adding 2 variable so just use subtract operation.
>
> }
> On Sat, Mar 3, 2012 at 5:56 PM, jai gupta <[email protected]> wrote:
>
>> use pascal's triangle
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> AMRIT
>
>
--
AMRIT
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.