树形与扁平互转