Determine the growth function and order of the following code fragment:

What will be an ideal response?

```
for (int count = 0; count < n; count ++)
{
for (int count2 = 0; count2 < n; count2 = count2 + 2)
{
System.out.println(count, count2);
}
}

The outer loop will be executed n times. The inner loop will be executed (n+1)/2 times. Therefore, the growth function for the code fragment is n*((n+1)/2) = (n2 + n)/ 2. That is order n2.

```

Computer Science & Information Technology

You might also like to view...

The New Connection Security Rule Wizard enables you to create connection security rules. Which type of rule enables you to limit connections according to authentication criteria you define?

a. Isolation b. Authentication Exemption c. Server-to-server d. Tunnel

Computer Science & Information Technology

___ is easily implemented as a round-robin or circular buffer technique.

A. FIFO B. LRU C. LFU D. CBT

Computer Science & Information Technology