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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started