Which is best regarding the time and space: Bloom filter, Hash table or Dictionary?

前端 未结 3 1547
余生分开走
余生分开走 2021-02-07 20:40

I need to store 4000 string of fixed size (8-char) in C#, but I do not know what is best to use regarding the space and time of adding and retrieving the item: Bloom filter, Has

3条回答
  •  眼角桃花
    2021-02-07 21:38

    A System.Collections.Hashtable back in .NET 1.0 is really just the same as System.Collections.Generic.Dictionary, which it is introduced in .NET 2.0.

    I would suggest you to use Dictionary since it is type safe by specifying your key and your value type. Hashtable only takes a object type, you will have to cast it back to a string every time you retrieve the data.

提交回复
热议问题