maximum temperature drop. Now she has the following problem; in a series of measurements she discovers one data point is

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

Interpolation
Assignment Description
Meike, our climate scientist, was very happy with the program you wrote to calculate the maximum temperature drop. Now she has the following problem; in a series of measurements she
discovers one data point is missing, but not which one. She does know that the measurements
show a constant increase.
Write a function, interpolate(list), that completes a given series. Provide as output the index
behind which the element should be inserted and the value. You can assume that the measurements are natural numbers and that the input consists of at least 3 measurements. You can assume
that both the first and the last data point have not been dropped
P.S. Meike is in a hurry; your algorithm must run in O(log n) time.
Example
Input Output 1 Output 2
[1, 2, 4] 1 3
[3, 7, 11, 19] 2 15
Notes
Make sure to turn in your code with the filename “Interpolation.py”. If you turn it in with
any other name it will fail the tests. This is due to instead of this assignment giving you an input
and you having to print an output. This assignment will run unit tests on your program itself. 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Recurrence Relation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning