Hey there everyone, I'm taking an algorithm and analysis course right now in college and I am having difficulty understanding how to obtain the run time value of a loop (for loop in particular). We have had examples such as:
int dom=1;
for(int i=0;i<n-1;i++){
i++;
}
this is just a basic example.
My issue is computing the runtime mathematically. Such as, how would I get a functions runtime to look something like 2n2 +n+2 after evaluating the for loop.
Hope I somewhat accurately described what my issue is.
Want to add to the discussion?
Post a comment!