I am not able to understand time complexity of this for loop. While outer loop is O(n) the inner loop jumps certain calculation. How to find the complexity?
public void function(n) {
for(int i = 1; i< n; i++) {
for(int j = 1; j <= n; j += i) {
System.out.println("*")
}
}
}
n
. – dkaeae Dec 19 '18 at 10:12