Изменения
→Псевдокод
right_segments.add(s);
sort(left_segments) // by increasing of x_mid - segment.left
sort(right_segments) // by increasing decreasing of segment.right - x_mid
result.left = build(left_child);
result.right = build(right_child);