I understand that each recusive function must have one base case(A solution given directly) however they may also have two. This is where I get confused see below. Is my thinking below correct or way off?
if I broke these in two parts as below I would have two base cases. I think it still says the same as (this |or| that) Am I on the right track.Code:int funct1(int m, int n) { if (m==n || n==1) // single base case return 1; else return funct1(m-1,n-1) + n*func1(m-1, n); }
Code:int ................... if (m==n) return 1 //1st base case else if (n==1) return 1 // 2nd base case else .........................



LinkBack URL
About LinkBacks


