• Log in or sign up for an account here: https://www.sythe.org/login

[Global]Reported Post by blindkilla

Status
Not open for further replies.

blindkilla

Guru

$25 USD Donor New
Joined
Jun 22, 2005
Sythe Gold
6
Messages
1,896
Location
Canada
Discord Unique ID
282000633404456960
Discord Username
sogord
blindkilla has reported a post.

Reason:
This guy posted two spam posts in this thread. Both his posts are irrelevant to the thread.
Post: omg homework help!!!
Forum: C++ / C
Assigned Moderators: N/A

Posted by: Bdubb
Original Content:
for (i = 0; i < n; i++)
printf(&#8220;%d&#8221;, i);

loop will execute n times

O(N)
f(N) = n

for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = 0; k < n; k++)
printf(&#8220;%d %d %d\n&#8221;, i, j, k);

above printf will execute n * n * n = n^3 times

O(n^3)
f(N) = n^3

5) O(N)
6) O(n^3)
 
Status
Not open for further replies.
duelarena.gg
Back
Top