Question: 2. (Performance Testing) We examine the code in Section 12.2 with a view to improving its run-time performance. Answer the following questions by writing code

2. (Performance Testing)

We examine the code in Section 12.2 with a view to improving its run-time performance.

Answer the following questions by writing code to compare the performance of candidate solutions:

a) The sum of the elements in row n versus the nth power of 2.

b) Computing the binomial coefficients using Boost C++ Math Toolkit versus lookup in Pascal’s triangle.

c) Computing the Fibonacci sequence by using elements in Pascal’s triangle versus the formulae in equations (12.3) and (12.4).

You can use the C++11 chrono library or the stopwatch class from Chapter 10 to measure the performance.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting For Financial Instruments Questions!