Iterative vs. Recursive Programming

There are different approches to solve problems in programming. One is the iterative approche and the other the recursive one. Let us look at a commonly known function, the factorial function, for example 6! which is 6*5*4*3*2*1=720. An iterative algorithm in Java would look like this: int iterative(int n) {       int res = 1;… Continue reading Iterative vs. Recursive Programming

Published
Categorized as coding