Diameter and k-center in sliding windows