3 ms·
I think the question is whether sort should return a new, sorted array or whether it should sort the array in place. In functional languages it is the former,
by petrzjunior 11mo ago
I think the question is whether sort should return a new, sorted array or whether it should sort the array in place. In functional languages it is the former, in imperative the latter.
- knome 11mo agoIt can be quite useful to have nondestructive sorting in imperative languages as well. Hence python introducing 'sorted' even though '.sort()' preceded it.