Suppose you have algorithms with five running times. Assume these are the exact running times. How much slower do each of these algorithms get when you (a) double the input or (b) increase the input size by one? Do both. This problem requires discrete math. I solved all of these but I had a quick question. My teacher wanted us to use the big 0 notation for these running times, but the problem is that I'm not sure if that's necessary for these problems for the question it's asking. I tried to the big 0 notations for the first three. For (a) I got 8n3. Which I'm not sure is right. For example, for 1b I got 3n2 + 3n + 1 for how much slower these get from the original. Is that correct? Was I supposed to do something more for the big 0 notation. You can check to see if these answers are correct. The big O notation formula is f(n) = 0(g(n)). (a) n2 For double size I got 4n2. I got 2n + 1 from the input the size by one. I think that's all I need to do. I got similar answers for theother ones. (b) n3 I got 2n3 for doubling the size. 3n2 + 3n + 1. (c) 100 n2 (d) n log n (e) 2n
Suppose you have
This problem requires discrete math. I solved all of these but I had a quick question. My teacher wanted us to use the big 0 notation for these running times, but the problem is that I'm not sure if that's necessary for these problems for the question it's asking. I tried to the big 0 notations for the first three. For (a) I got 8n3. Which I'm not sure is right. For example, for 1b I got 3n2 + 3n + 1 for how much slower these get from the original. Is that correct? Was I supposed to do something more for the big 0 notation. You can check to see if these answers are correct.
The big O notation formula is f(n) = 0(g(n)).
(a) n2
For double size I got 4n2. I got 2n + 1 from the input the size by one. I think that's all I need to do. I got similar answers for theother ones.
(b) n3
I got 2n3 for doubling the size. 3n2 + 3n + 1.
(c) 100 n2
(d) n log n
(e) 2n
Trending now
This is a popular solution!
Step by step
Solved in 2 steps