piecewise-linear interpolation
The simplest honest way to draw a curve through data is to connect the dots with straight lines — exactly what a spreadsheet line chart does. Piecewise-linear interpolation does precisely that: between each pair of neighbouring data points it draws the straight segment joining them, and the whole interpolant is the resulting broken line.
On the interval between x_i and x_{i+1}, the value is the obvious linear blend p(x) = y_i + (y_{i+1} - y_i) (x - x_i) / (x_{i+1} - x_i). To evaluate at a query x you find which interval it falls in (a quick search in the sorted nodes) and apply that one formula. The result passes through every data point and is continuous, but it has corners — its slope jumps at each node, so it is not smooth (its first derivative is discontinuous). It is the degree-1 member of the spline family. Its error between nodes is well understood: it is bounded by about (h^2 / 8) times the maximum of the second derivative |f''|, where h is the spacing — so halving the spacing cuts the error by about four (second-order accuracy).
Its virtues are robustness and locality: it can never oscillate or overshoot the way high-degree polynomials do (it stays within the range of the local data), each piece depends only on two neighbours, and it is dirt cheap to build and evaluate. That is exactly why it sidesteps Runge's phenomenon and why it is the default for plotting, lookup tables, and texture sampling in graphics. The honest cost is the corners and the modest accuracy: where you need a smooth derivative (for physics, animation, or further differentiation) you step up to cubic splines, which keep the locality and robustness but add smoothness.
Data (0, 0), (2, 4), (3, 1). For x = 1 (in [0, 2]): p = 0 + (4-0)(1-0)/(2-0) = 2. For x = 2.5 (in [2, 3]): p = 4 + (1-4)(2.5-2)/(3-2) = 4 - 1.5 = 2.5. The curve is two straight segments meeting with a sharp corner at (2, 4).
Connect-the-dots: continuous, robust, but with corners.
Piecewise-linear interpolation is continuous but NOT smooth — its derivative jumps at every node. It also never overshoots, which is exactly why it dodges Runge's phenomenon; the price is the corners and only second-order accuracy.