Reputation: 2661
What is the best data structure to store a list of client's ip addresses?
I think there are no any strict limitations on memory size or lookup speed since it is a ip address filter application.
I was thinking about dictionary, but probably it is gives too much overhead for storing such a simple thing as unique list of addresses. Hashtable is essentially based on dictionaries as well.
Array is not good because you have to allocate too much space even for storing few addresses. List is not unique.
Upvotes: 0
Views: 1819