Was macht man denn bei MidSquare, wenn garkein Index passt? Nehmen wir als Beispiel denmid square - The decimal representation of the key is interpreted as
a natural number and multiplied by itself. From the middle of the
result of this multiplication some digits (number of digits is equal to
the length of an address in the Hash-Table) are used as the address in
the Hash-Table. You should start from the 10-th digit from the right.
For example if the multiplication delivers 7766279611452241921 and
the length of an address is 3 then you should use 611 as the address
to store the corresponding entry if the capacity of the Hash-Table
exceeds 611
Eintrag "Z8IG4LDXS" mit seiner Ascii-Repräsentation der ersten 5 Stellen dargestellt als 9056737152.
Multipliziert mit sich selbst ergibt das 82024487840417071104 (wo kommt die Zahl 7766.. aus der Beschreibung her?!),
von welcher Zahl ich widerrum die ersten zehn Stellen nehmen soll: 8202448784.
Jetzt soll man von rechts nach links gehend den Index suchen. Wenn man beispielsweise 10.000 Einträge hat,
kann man weder die Zahl 48784 noch 82024 zum hashen nutzen.
Wie soll man dann weiter vorgehen? 0 zurückgeben? Abbrechen?