Hot cup with JAVA Technologies!!
Java, Struts, Spring, Hibernate, Unix,IT, Software, Jobs, Interview, Aptitude, Learning, Algorithms
Sunday, October 31, 2010
Prime factorization
public void primeFactor (int num){
List factors = new ArrayList();
for (int i = 2; i <= n; i++){
while (n % i == 0){
factors.add(i);
n /= i;
}
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment