I understand that you keep the items and just mark them as deleted when they are removed in a HashMap using linear probing. However, when you resize the HashMap do you also add the deleted Items?
If you're using that kind of linear probing in a resizable hash table, you should make a few changes to the usual resizing rules.
Remember that the objectives are:
So, when the table fills up (1/2 slots full in this example), you resize, and:
A resize with N non-deleted items takes O(N) time, and after each resize it takes at least N operations to get to the next one, which provides the O(1) amortized expected time per operation that we need.
If your implementation requires a power-of-two or prime-numbered table size, then it's OK if you pick the closest one to 4N, or the next bigger one.