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?
source
share