Data structure in c for quick search / insert / delete of integers (from known end region)

I am writing a mobile phone game in c. I am interested in a data structure that supports fast (if possible, depreciation O (1)), insert, view and delete. The data structure will store integers from the region [0, n], where n is known in advance (this is a constant) and n is relatively small (about 100000).

So far, I have been looking at an array of integers where the โ€œiโ€ bit is set if the set contains the integer โ€œiโ€ (therefore a [0] are integers from 0 to 31, a [1] are integers 32 to 63 and etc.).

Is there an easier way to do this in c?

+3
source share
2

- 100000/8 = 12,5 , .

+4

, 100 000 . - "-".

+1

Source: https://habr.com/ru/post/1746768/


All Articles