while computing the ncr function what is the order of call of the three factorial functions?
Call stack issue
Basically, the formula for ncr is n! / [(n-r)! * ® ! ]… So as per wht is explained in the video lecture given, firstly the call stack would contain main function , from where the program starts, and a function call is made to ncr function, then in the ncr function, firstly your call stack will call factorial ( n ), it would compute the value and return that value to the call stack, then in ncr function , another call is made to factorial (n-r), then again its value is computed and return to the call stack, and lastly a call to factorial® is made and after computing the value, again it is returned to the call stack… This is the order of call stack…