We consider the problem of evaluating a functional expression comprising the nested sums and infimal convolutions of convex piecewise-linear functions defined on the reals. For the special case where the nesting is serial, we give an O(NlogN) time algorithm, where N is the total nunber of breakpoints of the functions. We also prove a lower bound of fl(N log N) on the number of comparisons needed to solve this problem, thus showing that our algorithm is essentially optimal. For the general case, we give an O(Nlog 2 N) time algorithm. We apply this latter algorithm to the linear cost network flow problem on series-parallel networks to obtain an O(m log 2 m) time algorithm for this problem, where in is the number of arcs in the network. This result improves upon the previous algorithm of Bein, Brucker, and Tailir which has a time complexity of O(nm+m log m), where n is the number of nodes.KEY WORDS: Convex program, balanced binary search tree, infimal convolution, series-parallel graphs, linear cost network flow.