Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
12
Task/Hash-from-two-arrays/XPL0/hash-from-two-arrays.xpl0
Normal file
12
Task/Hash-from-two-arrays/XPL0/hash-from-two-arrays.xpl0
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
func Code(Str); \Return a simple, perfect hash code for the Keys used here
|
||||
char Str;
|
||||
return Str(2) & 7;
|
||||
|
||||
int Keys, Values, I, Hash(8);
|
||||
[Keys:= ["first", "second", "third", "fourth", "fifth", "sixth"];
|
||||
Values:= [1, 2, 3, 4, 5, 6];
|
||||
for I:= 0 to 6-1 do
|
||||
Hash(Code(Keys(I))):= Values(I);
|
||||
IntOut(0, Hash(Code("second"))); CrLf(0);
|
||||
IntOut(0, Hash(Code("sixth"))); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue