3 ms·
You're exactly right. Any insert will end up incrementing every node on its right. Any deletion, will end up decrementing every node on its left. It's possib
by sanj 17y ago
You're exactly right. Any insert will end up incrementing every node on its right. Any deletion, will end up decrementing every node on its left.
It's possible you could do the deletions silently, because you don't actually care about gaps. But I don't see any way around inserts being expensive.