|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttp.prof.classes.Recursivite
public class Recursivite
Une classe utilitaire qui contient des méthodes récursives.
Constructor Summary | |
---|---|
Recursivite()
|
Method Summary | |
---|---|
static int |
fac(int n)
Calcul récursif de la factorielle : fac(0)=fac(1)=1 et fac(n) = n * fac(n-1) |
static int |
pgcd(int n,
int m)
Calcul récursif du pgcd : pgcd(n,0) = n et sinon pgcd(n,m) = pgcd(m,n%m) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Recursivite()
Method Detail |
---|
public static int pgcd(int n, int m)
n
- le premier paramètrem
- le second paramètre
public static int fac(int n)
n
- un entier positif
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |