In many books, syllabus, tutorials I've seen that a good option to find a proper cell of an item is to calculate a number of the cell: item.hash()%(n-1) = # of the bucket.
But why is this certain expression is mentioned?
How does the inverse one (n-1)%item.hash() = # of the bucket
differs from it?
P.S. I know that Java HashMap uses (n - 1) & hash
, I would like only to catch the difference in sparsing key between these two approaches.