In 1951, Diliberto and Straus [5] proposed a levelling algorithm for the uniform approximation of a bivariate function, defined on a rectangle with sides parallel to the coordinate axes, by sums of univariate functions. In the current paper, we consider the problem of approximation of a continuous function defined on a compact Hausdorff space by a sum of two closed algebras containing constants. Under reasonable assumptions, we show the convergence of the Diliberto-Straus algorithm. For the approximation by sums of univariate functions, it follows that Diliberto-Straus's original result holds for a large class of compact convex sets.Mathematics Subject Classifications: 41A30, 41A65, 46B28, 65D15