Implement an algorithm for calculating the least squares approximation (Linear and Polynomial).
The program gets information about the points through a text file (input.txt). The first line contains the degree of polynomial and number of points. The following two lines have the x and y of the points.
Example file:
2 5
0 0.25 0.5 0.75 1.00
1.0000 1.2840 1.6487 2.1170 2.7183