On Wednesday, 1 January 2014 at 21:54:13 UTC, Cooler wrote:
RedBlackTree can help me. But RedBlackTree uses O(log(n)) time for insert/remove operations.

If that is too slow, maybe you could roll your own simple hash table with open addressing and set the entries to negative values rather than delete? If the values/access patterns/hash/table size is right you might get O(1) and no need for bounds checks on array indexing either.

I assume basic associative arrays will have a more costly/generic hash function and need to rehash the table a few times as it grows.

Reply via email to