Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Im confused on this problem How do I figure out the execution time in Big O notation for the implementations below. The execution time in
Im confused on this problem How do I figure out the execution time in Big O notation for the implementations below. The execution time in Big O of powe1(x, n) is O(n) and power3(x,n) is O(log(n)). How does that effect the implementation1-3 below?
(10 pts) An array of doubles can be used to represent a polynomial of one variable. The index of an item in the array represents the exponent, and the value of the array element is the coefficient of the term. For example, if the polynomial p(x) = 10x15 - 3.2x + x + 7.5 and is represented by an array p)then p[15] = 10.0, p[8] =-3.2, p[1] = 1.0, p[0] = 7.5, and the other items in the array are zeroes. The degree of a polynomial is the exponent of its highest term. For example, the degree of p(x) above is 15. The method evaluate(x) can be implemented in several different ways. What is the execution time of each implementation described below in Big O notation? Also, justify each answer. a) Implementation 1: value = 0; for (int i = 0; i = 0; i--) // d is the degree of the polynomial value = value * x + pli); return value; d) Which one is the most efficientStep 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