subject

Suppose you are choosing between the following three algorithms: 1) Algorithm A solves problems by dividing them into five subproblems of half the size, recursively solving each subproblem, and then combining the solutions in linear time.
2) Algorithm B solves problems of size n by recursively solving two subproblems of size n - 1 and then combining the solutions in constant time.
3) Algorithm C solves problems of size n by dividing them into nine subproblems of size n/3, recursively solving each subproblem, and then combining the solutions in O(n^2) time.
What are the running times of each of these algorithms (in big-O notation), and which would you choose?
a) This is a case of the Master theorem with a = 5, b = 2, d = 1. As a > b^d, the running time is O(n^logb a) = O(n^log2 5) = O(n^2.33).
b) T(n) = 2T(nβˆ’1)+C, for some constant C. T(n) can then be expanded to C * the summation from i = 0 to nβˆ’1 2^i+2^n * T(0) = O(2^n).
c) This is a case of the Master theorem with a = 9, b = 3, d = 2. As a = b^d, the running time is O(n^d log n) = O(n^2 log n).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
You know the right answer?
Suppose you are choosing between the following three algorithms: 1) Algorithm A solves problems by...
Questions
question
Mathematics, 20.08.2021 21:40
question
Mathematics, 20.08.2021 21:40
question
Mathematics, 20.08.2021 21:40
Questions on the website: 13722367