ferociouscoder.com
Factors - Ferocious Coder
A naive way of figuring out the number of factors of a particular number is to try every number from 1 up to the number itself. public ArrayList getFactors(int N) { ArrayList factors = new ArrayList(); for (int i=0; i if (N%i==0) { factors.add(i); } return factors; } We can do much better than this … Continue reading Factors →
Rawrosaur