Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

euclidean algorithm java recursive

private int euclidean (int a, int b) {
        if (a==b){
            return a;
        }else{
            if (a>b){
                return euclidean (a-b,b);
            }
            if (b>a){
                return euclidean (a,b-a);
            }
        }
        return 0;
    }
 
PREVIOUS NEXT
Tagged: #euclidean #algorithm #java #recursive
ADD COMMENT
Topic
Name
7+4 =