­

How To Find Divisors Of a Number In Java

java 2:40 PM
There are various ways of finding divisors of a number. The most intuitive and basic approach can be for each element x from 1 to N check if N%x==0 then x is a divisor This works great for smaller values of n.But as n increases say > 10^5 it tends to take larger time. After some thinking we can easily deduce that a divisor...