Are there any written rules to determine runtime of a code? What would be the arithmethic actions that I have to use in outer loops and inner loops? A method in java language for example:
public static void mystery1(int n){
int k=n;// here I know that it’s O(1)
while(k>2){//O(k)
System.out.println(k);
k=(int)(Math.pow(k,1/3));
}
}
public static void dunno1(int n){
int i,j;
for(i=1;i<=n;i++){// Do I use multiplication between those loops?
for(j=1;j<=i;j++){
mystery1(n)n
}
}
}
Thank you.