3 ms·
Ordered is not the same thing as sorted. If you do swap-removals, there's no way to sort the array back into the original order unless you also keep track of in
by xigoi 6y ago
Ordered is not the same thing as sorted. If you do swap-removals, there's no way to sort the array back into the original order unless you also keep track of insertion time, which adds memory overhead.
- kllrnohj 6y agoStoring pointers in a linked list also adds memory overhead, too. Insertion time in nanoseconds is only 8 bytes - same as a single pointer on 64-bits. So half the memory usage as a doubly linked list.