Question: What is the big-O for the following program? for i in range(N): a = a + 5 for i in range(N): b = b +

What is the big-O for the following program?

for i in range(N):

a = a + 5

for i in range(N):

b = b + 10

1). O(1)

2). O(N)

3). O(N^2)

4). O(N^3)

5). O(2^N)

6). O(N!)

What is the big-O for the following program assuming N is the number of elements?

for i in range(100,N): for j in range(j,N):

for k in range(N-100)

x=i*j*k

1). O(1)

2). O(N)

3). O(N^2)

4). O(N^3)

5). O(2^N)

6). O(N!)

Which will take too long to compute, even for reasonably sized values of N?

1). O(1)

2). O(N)

3). O(N^2)

4). O(N^3)

5). O(2^N)

6). O(N!)

Given a Big-O of O(N^3), what is N?

- N^3

- number of elements

- time

- upper bound

- lower bound

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!