Write the algorithm which adds the sequence of integers


1. You can enhance polynomial evaluation algorithm by avoiding computing x^k repeatedly. For instance, x^3 is again computed when it finds x^4. Horner's polynomial algorithm is one example which avoids that. Write another polynomial estimation algorithm which avoids such inefficiency.

2. (a) Write the algorithm which adds the sequence of integers from 1 to n. For instance, for n = 5, an algorithm will do: 1 + 2 + 3 + 4 + 5 = 15. Utilize a_k for k-th integer. You may utilize while ... endwhile statement.

(b) Determine complexity of the algorithm.

(c) Compute the constant C and the function f(n) such that complexity function you found in (b) is less than or equal to Cf(n). Therefore, the algorithm has order no more than f(n). 

Request for Solution File

Ask an Expert for Answer!!
Mathematics: Write the algorithm which adds the sequence of integers
Reference No:- TGS0864237

Expected delivery within 24 Hours