3 ms·
It may be linear in the number of items, but not in the number of rightful places (you’d have to sort the items by rightful place first). Deciding on each right
by layer8 2y ago
It may be linear in the number of items, but not in the number of rightful places (you’d have to sort the items by rightful place first). Deciding on each rightful place also tends to not be constant-time.