home | Hashing |
![]() |
HashingV 0.1Hashing is a method to store data in an array so that storing, searching, inserting and deleting data is fast (in theory it's O(1)). For this every record needs an unique key. The basic idea is not to search for the correct position of a record with comparisons but to compute the position within the array. The function that returns the position is called the 'hash function' and the array is called a 'hash table'. In our examples our key is an integer value as is the actual data. [note that I use pascal syntax since this is easily readable by everybody I asume]
type THash_Record = record key : integer; data : integer; end; |