In this paper we study averaging algorithms and coverage control laws in a unified light. First, we characterize the convergence properties of averaging algorithms over acyclic digraphs with fixed and controlled-switching topology. Second, we introduce and study novel discrete coverage control laws, that are useful in practical implementations of coverage strategies. We characterize the close relationship of the novel discrete control laws with continuous coverage control laws and with averaging algorithms over a class of acyclic digraphs, that we term discrete Voronoi graphs. These results provide a unified framework to model a vast class of distributed optimization problems. Key words: Averaging algorithm, Consensus, Switching topology, Coverage control, Nonsmooth analysis