Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 3 . Describe the order of growth of each of the following code sections, using 0 notation: a . count = 0 ; for

43. Describe the order of growth of each of the following code sections, using 0 notation:
a. count =0;
for (i =1; i <=N; i++)
count++;
b. count =0;
for (i=1; i<=N; i++)
for (j=1; j<=N; j++)
count++;
c. value = N;
count =0;
while (value >1)
{
value = value /2;
Count ++;
}
d. count =0;
value = N;
value = N *(N-1);
count = count + value;
e. count =0;
for (i =1; i <=N; i++)
count++;
for (i = N; i>=0; i--)
count++;
f. count =0;
for (i=1; i<=N; i++)
for(j=1; j<=5; j++)
count++;
36. Write a program that declares a 10-element array of Date, uses a loop to initialize the elements to December 1 through 10 of 2005, and then uses another loop to print the contents of the array, one date per line.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Define the nature of interviews

Answered: 1 week ago

Question

2. Outline the different types of interviews

Answered: 1 week ago