umm.... since I was mentioned, bear with me few sentences...

I don't know much about sparse set, but after I read [this 
<https://www.geeksforgeeks.org/sparse-set/](https://forum.nim-lang.org/postActivity.xml#this-lthttpscolonslashslashwwwdotgeeksforgeeksdotorgslashsparseminussetslash)
 , it is obvious to me that the strength of sparse set is the O(1) clearing of 
all elements, which is rather different than a LRU cache. Also, from the data 
structure of sparse set, it can be said that it is very performant at its 
operations, though it has its own limitation on continuous range of integer as 
key and space requirement proportional to the size of range.

Btw, IMO, you don't have to think too much about the internal structure before 
hand. You can always improve the implementation as long as the interface 
unchanged. Maybe you can write a benchmark later to determine whether to use 
pairs or separate ones, though I think either case is likely fast enough to me 
and as a user, I wouldn't bother too much if one day I need a sparse set/map.

Anyway, looking forward to your package~ 

Reply via email to