It depends on the speed of the truck they're contained in.
If it is traveling at 50 km/h (14 m/s), it takes me 7e-5 seconds
to move them by one millimeter.
That's thoughput; consider latency: if a card weighs a gram, 10^10
weigh 10,000 tons. How fast can you accelerate that lot?[/QUOTE]
Good point. Maybe O(1) was too optimistic, but of course it
doesn't take one billion times longer than to move ten cards.
Maybe O(log N)?
Anyway, I don't think this could ever cause a bubble sort to be
faster than insertion sort. Also because swapping the 321495013th
card with the 6138274597th one can take a nontrivial amount of
time...
Consider the force needed to insert a card at the 5-billionth position.
It depends on how tightly packed they are. If they are loosely
packed enough, it will not be excessive. Only that just a few
cards are physically moved; but the indices of five billion cards
change very quickly.
(More seriously, whilst *notationally* the big-O notation is for
asymptotic growth as N approaches infinity, *in practice* it just
means "as N becomes large enough that additive constants can be
neglected". For example, when N becomes larger than (size_t)(-1),
a C implementation of a sorting algorithm becomes *very* tricky,
but this isn't usually an issue, even when considering the big-O
notation.)