私はこのような配列を持っているとしましょう:
$arr_sequences =
array('00-02', '02-03', '03-07', '23-03', '03-23', '07-11', '11-10', '11-11');
値が次のようになるように配列をソートする方法:
$arr_sequences =
array('00-02', '02-03', '03-23', '23-03', '03-07', '07-11', '11-11', '11-10');
よく見ると、各値には id (コード) があり、次のように分割され-
ます。例:
$arr_sequences[2] = '03-07'; // '07' as last code, then search another value with '07' in front of the value
次に、次のインデックス値は
$arr_sequences[5] = '07-11'; // '07' front, then search '11' as next value
目標は、長さを失わずに配列をソートすることです。
ツリーアルゴリズムを試しましたが、うまくいきません。