A Method for Geodesic Distance on Subdivision of Trees with Arbitrary Orders and Their Applications