r/cpp • u/compilersarefun • Jun 23 '26
Two Indexed Hash Tables
https://vnmakarov.github.io/data%20structures/c/c++/open-source/2026/06/23/two-indexed-hash-tables.html
33
Upvotes
r/cpp • u/compilersarefun • Jun 23 '26
View all comments
Show parent comment
3
u/compilersarefun Jun 23 '26
There is no tag value for deleted elements. But there is special index value (~0) for deleted elements. So probing a deleted element requires only checking index after we pass the tag.
Such approach speeds up finding empty elements and table works faster when we have no deleted elements. There is a down side too when we have many deleted elements.