You are viewing a single comment's thread. Return to all comments →
static boolean isPrime(int n){ if(n==2 || n==3 ) return true; if(n<=1 || n%2==0 || n%3==0) return false; for(int i=5;i*i<=n;i+=6){ if(n%i==0 || n % (i + 2) == 0) return false; } return true; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 25: Running Time and Complexity
You are viewing a single comment's thread. Return to all comments →