begin
Input: n (pos. Integer)
Output: y (pos. Integer)
Other: x, z (pos. Integer)
y := 0;
x :=0;
while x < n do
y := y + 1;
z := 0;
while z < 4 do
x := x + 1;
z := z + 1;
end;
for (i=0;i<2;i++){
x=x-1;
}
End;
How is this done? I know that when there is a for loop it's O(N) and when there is a while it's O(log N) . I would appreciate the help :)
Thank you