Question: A research team in oceanography has a probe that sends back temperature readings at regular time intervals. Unfortunately, they think the probe is faulty: not
A research team in oceanography has a probe that sends back temperature readings at regular time intervals. Unfortunately, they think the probe is faulty: not only does the team not know how "regular time intervals" is supposed to be defined, but they think some of the measurements haven't been transmitted and are therefore missing from the received data.
The input to your algorithm will be an array A of measurement times. For simplicity, we will assume each time is a nonnegative integer. If the measurements don't exclude any data, then the array A will be of the form a a c ac an c where A has length n for n and c is the constant time interval between two consecutive measurements.
However let us suppose the probe failed to send k measurements, but that neither the first nor the last measurement were skipped. For example, the missing measurement times in might be and
What if you are not told k but you are given an upper bound K on its value. You will be able to determine c and k as long as the array you receive contains at least fK values.
What is fK and why?
Can you provide a detailed explanation of how to determine fK
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
