big-o

admin

Administrator
Staff member
I've had a quiz with big-o problems and I still don't get it, can you guys help me:<br /><br />for (int j = 1; j<=20; j++)<br />sum++;<br /><br />why does this run on the order of O(1)??<br /><br />for (int k = n; k>0; k=k/2)<br />sum++;<br /><br />why does this run on the order of O(log n)??
</div>
 
Back
Top