1

Basically, you have $n$ integers. The data structure is for your choice, it is ok to do polynomial time preprocessing on them. Then you have multiple questions "Is an integer $k$ in the set?"

My question is about the best way we know in terms of time/space to answer this query. Ultimately, the time should be guaranteed (not randomized) and the space must be polynomial of $n$.

Firstly, one can use let's say 2-3 Trees or another type of search trees to do this in $O(log n)$ time and $O(n)$ space.

Secondly, one might say that it can be done in $O(1)$ with hashing, however I should note that this time is random and we are looking only for deterministic algorithms. Universal hashing requires a lot of space.

So, one way to approach the main question is to answer if there is a perfect hashing constructable in poly-time and poly-space?

Another approaches are also appreciated. Thanks.

Eugene
  • 1,086
  • 1
  • 6
  • 14
  • how big is the set from which k-values are drawn? Are you going to make deletions from your structure, or will be an insert/search only data structure? – Curious_Dim Jan 26 '18 at 23:59
  • No modifications required. The integers themselves are not too big, but the number of queries is significant (might be multiple queries, though not guaranteed). – Eugene Jan 27 '18 at 00:08
  • By saying significant number of queries, do you mean different type of queries? – Curious_Dim Jan 27 '18 at 00:24
  • Significant number of queries "Is an integer $k$ in the set? (with different $k$'s obviously). Hope this helps. – Eugene Jan 27 '18 at 00:26
  • will there are deletions from the set? i.e. will you ever remove an integer $k$ from the set so subsequent search queries should return "there is no such integer in the set" ? – Curious_Dim Jan 27 '18 at 00:29
  • if $U$ is all the possible integers will be $U < n$? – Curious_Dim Jan 27 '18 at 00:36
  • 1
    Polynomial in what? Best in what sense? I also think this is too broad in its current form, as you are asking for the result of a big literature review. – Raphael Jan 27 '18 at 00:37
  • What's the motivation? Are you looking for a practical solution or are you interested from a theoretical perspective? If you're looking for something practical, I wonder about whether your requirement for deterministic time is well motivated? 2. Are you OK with a randomized preprocessing? Are you OK with a preprocessing that has deterministic poly-time and poly-space, but has a $1/2^{1000}$ chance of failing?
  • – D.W. Jan 27 '18 at 01:18
  • "Universal hashing requires a lot of space." - I'm not sure what you're referring to here (and it seems you've ruled out universal hashing based on your requirement for deterministic time complexity anyway).
  • – D.W. Jan 27 '18 at 01:18
  • 1
    Related question: https://cs.stackexchange.com/questions/20070/looking-for-a-set-implementation-with-small-memory-footprint/ – Pseudonym Jan 31 '18 at 04:54