The Calculus of Ada

From programming_contest
Jump to navigation Jump to search

This problem asks us to determine the degree of a polynomial using the method of successive differences, and to evaluate the polynomial were the series to be continued.

Simply apply the method given until you find a series where all elements are identical. Once that is done, simply add the last number of each list to the END of the next higher list starting at the "constant" list until you've gotten the last number of the original series.

The problem is probably easiest by using an array of n+1 by n+1, putting the input list in the top row, and then filling in each subsequent row left justified. Then it's just a loop of array iterations.