New answers tagged

1 vote
Accepted

Efficient algorithm to count number of intersections of n sets

Assuming you really need the number for all pairs of sets and hearing that we are thinking of users in communities you could use the following algorithm which relies on the idea that the the average ...
user avatar
  • 1,106
1 vote

Dictionary with sets as keys where lookup can be set intersection

My understanding: You might have three values in the table with keys (a, b), (a, c), (b, c). When you lookup (d, e, c) you want the values for the keys (a, c) and (b, c) containing a “c”. First you ...
user avatar
  • 25.2k
1 vote

Dictionary with sets as keys where lookup can be set intersection

Unfortunately, no, this isn't achievable (at least not if you want to handle arbitrary sets as keys). The reason is simple: if $N$ denotes the number of elements in a key set, then it takes $O(N)$ ...
user avatar
  • 141k

Top 50 recent answers are included