Linear Time Algorithms for Tree Root Problems