Add segmentTre Algorithm