[Oberon] How to mimic an associative array

Yaroslav Romanchenko tobject at bk.ru
Thu Dec 2 10:06:18 CET 2010


> All good advise! I wonder though, if we're talking about the same
> thing? Somehow implementing a Perl-like associative array, using basic
> Oberon-2 data-types? As in: http://en.wikipedia.org/wiki/Hash_table

Simplest solution is to use array for hash table. Size of array should has enough space for data entries and some amount of waste space for good performance.
Collision resolution mechanism also needed.
Look into CyrillicUtilities.Mod for inspiration (hashSearch procedure). The key in this hash is the array index.

---
Cheers, SAGE
http://sage.com.ua/




More information about the Oberon mailing list