Given below is the odd-number function. Which of the following are equal to O(20)? Check all that apply.
O(n) = 2n - 1
A.
O(19) + 1
B.
The twentieth odd number
C.
39
D.
19
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (phi):
The first step. If you are given
O(n) = 2n - 1
to find O(20) replace n with 20 in the formula. what do you get?
OpenStudy (anonymous):
B A??
OpenStudy (phi):
replace n with 20 in the formula. what do you get?
OpenStudy (phi):
replace n with 20 in the formula in
2*n - 1
^
|
change the n to 20 and do the arithmetic
what do you get?
OpenStudy (anonymous):
19
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
and B?
OpenStudy (phi):
How did you get 19?
OpenStudy (anonymous):
20 -1
OpenStudy (phi):
the formula says
O(n) = 2n - 1
2n-1 means multiply n by 2 then subtract 1
replace n with 20 in the formula
2*n - 1
^
|
change the n to 20 and do the arithmetic
OpenStudy (phi):
If you don't do anything except change n to 20 what do you get ?
2*n - 1
Still Need Help?
Join the QuestionCove community and study together with friends!