A total map is a map that is defined everywhere.
For this data structure, we only consider a special kind of total maps: the ones that are non-zero at at most a finite number of points. TotalHashMap can then be implemented using an ordinary HashMap for keys with non-zero values, and assume zero everywhere else.
EDIT: by "zero" I mean any constant value, not necessarily related to any algebraic notion of zero. So a better phrasing would be that we consider total maps that are constant except for at most a finite number of points.
A total map is a map that is defined everywhere.
For this data structure, we only consider a special kind of total maps: the ones that are non-zero at at most a finite number of points.
TotalHashMapcan then be implemented using an ordinaryHashMapfor keys with non-zero values, and assume zero everywhere else.EDIT: by "zero" I mean any constant value, not necessarily related to any algebraic notion of zero. So a better phrasing would be that we consider total maps that are constant except for at most a finite number of points.