Adaptive Approximation Algorithms for Ranking, Routing and Classification