Iterative Algorithms For Distributed Optimization With Applications To Multi-Agent Estimation And Control