Question: QUESTION 3 What is the time complexity in big Oh for the program segment below? (DO NOT use any space in your answer please) for

QUESTION 3

What is the time complexity in big Oh for the program segment below? (DO NOT use any space in your answer please)

for (i=1; i<=n; i++)

print "*";

2 points

QUESTION 4

What is the time complexity in big Oh for the program segment below?

for (i=1; i<=n; i++)

for (j=n; j>i; j--)

print "*";

A.

O(n2)

B.

O(n*(n-1)/2)

C.

O(n+(n-1)+...+1)

D.

O(n)

2 points

QUESTION 5

What is the time complexity in big Oh for the program segment below?

for (i=1; i<=n; i++)

for (j=1; j<=n; j++)

print "*";

A.

O(1)

B.

O(n2)

C.

O(2n)

D.

O(n)

2 points

QUESTION 6

What is the cost of the following program segment?

a=b

A.

O(nlogn)

B.

O(n)

C.

O(1)

D.

O(C)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!