(New page: '''Recursion''' --Divide and Conquer if(termination condition) { solve the problem } else { break the problem into smaller parts and solve } '''EX''' -- fibonacci int fi...) |
|||
Line 22: | Line 22: | ||
return fib( n - 1 ) + ( n - 2 ); | return fib( n - 1 ) + ( n - 2 ); | ||
} | } | ||
+ | |||
+ | |||
+ | [[''''''(**the format is not at basic coding standards due to the "Rhea" text editor)'''''' | ||
+ | ]] |
Latest revision as of 16:41, 5 May 2011
--Divide and Conquer
if(termination condition) { solve the problem }
else { break the problem into smaller parts and solve }
'''EX''' -- fibonacci
int fib(int n) { if( n == 0 | | n == 1) return 1;
return fib( n - 1 ) + ( n - 2 ); }
[['(**the format is not at basic coding standards due to the "Rhea" text editor)'
]]