MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / fct

Method fct

Java/Recursion/FactorialN.java:5–11  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

3{
4 public static int f; //Global variable
5 static void fct(int n) //Tail recursive version
6 {
7 if (n <= 1)
8 return;
9 f *= n;
10 fct(n-1); //All Set and done
11 }
12 /*
13 static int fct(int n) //Head recursive version
14 {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected