3 ms·
Technically the list is not being modified but the comparison operator is dynamically determining the order of elements when the sorting algorithm checks them.
by account42 5y ago
Technically the list is not being modified but the comparison operator is dynamically determining the order of elements when the sorting algorithm checks them. This is done in a way so that the order of pairs that have already been checked previously remains fixed and it results in a valid totally ordered comparison operator in the end - but the order it ends up with depends on the sorting algorithm.