A function int fint x s being tested by providing every poss

A function int f(int x) s being tested by providing every possible 32 bit int as an argument and checking the result. The full test takes 2s.

The code is then rewritten to take a 64 bit integer as an argument. Assuming the execution time of the code does not change, how much time it it takes to test every possible input value.

How much time does the function f takes foe a single execution.

Solution

To (in C99 and up) portably print 64 bit integers, you should #include <inttypes.h> and use the C99 macros PRIx64 and PRId64. That would make your code;

time taken to execute for each test value is 2seconds power 2 =4 seconds

and for single execution of the function , n*2^2 where n is the number of lines in the function

A function int f(int x) s being tested by providing every possible 32 bit int as an argument and checking the result. The full test takes 2s. The code is then r

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site