TwitAA 2012-02-08 03:06:00
[TwitAA 2012-02-08 03:06:00]
mergeSort [20, 7, 10, 11, 3, 87, 61, 15]
=> ms 8 [20, 7, 10, 11, 3, 87, 61, 15]
=> merge (ms 4 [20, 7, 10, 11]) (ms 4 [3, 87, 61, 15])
=> merge (merge (ms 2 [20,7]) (ms 2 [10,11]))
(merge (ms 2 [3,87]) (ms 2 [61,15]))
=> merge (merge (merge (ms 1 [20]) (ms 1 [7]))
(merge (ms 1 [10]) (ms 1 [11])))
(merge (merge (ms 1 [3]) (ms 1 [87]))
(merge (ms 1 [61]) (ms 1 [15])))
=> merge (merge (merge [20] [7]) (merge [10] [11]))
(merge (merge [3] [87]) (merge [61] [15]))
=> merge (merge (7 : merge [20] []) (10 : merge [11] []))
(merge (3 : merge [87] []) (15 : merge [61] []))
=> merge (merge (7 : [20]) (10 : [11]))
(merge (3 : [87]) (15 : [61]))
=> merge (merge [7, 20] [10, 11])
(merge [3, 87] [15, 61])
=> merge (7 : merge [20] [10, 11])
(3 : merge [87] [15, 61])
=> merge (7 : 10 : merge [20] [11])
(3 : 15 : merge [87] [61])
=> merge (7 : 10 : 11 : merge [20] [])
(3 : 15 : 61 : merge [87] [])
=> merge (7 : 10 : 11 : [20])
(3 : 15 : 61 : [87])
=> merge [7, 10, 11, 20] [3, 15, 61, 87]
=> 3 : merge [7, 10, 11, 20] [15, 61, 87]
=> 3 : 7 : merge [10, 11, 20] [15, 61, 87]
=> 3 : 7 : 10 : merge [11, 20] [15, 61, 87]
=> 3 : 7 : 10 : 11 : merge [20] [15, 61, 87]
=> 3 : 7 : 10 : 11 : 15 : merge [20] [61, 87]
=> 3 : 7 : 10 : 11 : 15 : 20 : merge [] [61, 87]
=> 3 : 7 : 10 : 11 : 15 : 20 : [61, 87]
=> [3, 7, 10, 11, 15, 20, 61, 87]