2 ms·
OK, so I was being a bit fast and loose with my description of insert. What I was going for is it doesn't copy and scan the entire list every time. It's also n
by asveikau 11y ago
OK, so I was being a bit fast and loose with my description of insert. What I was going for is it doesn't copy and scan the entire list every time.
It's also not too hard to imagine a constant time implementation. The api would allow for it. Whereas poll is broken at the api level. It assumes O(n) at every call and there's no good way to get around it.