Page 1 of 1

Given the following 16 airport records, show the hash map using the given hash function. Assume hash map uses linear imp

Posted: Fri Jul 08, 2022 6:38 am
by answerhappygod
Given the following 16 airport records, show the hash map usingthe given hash function. Assume hash map uses linear implementationwith a Queue. The first 3 characters of each record are the airportkey. Assume the table size is 19.
AES VIGRA ALESUND NORWAY 62 33 37 N 6 6 36 E 69
FMI KALEMIE KALEMIE ZAIRE 5 52 32 S 29 15 0 E 2569
CFS COFFSHARBOUR COFF'SHARBOUR AUSTRALIA 30 19 14 S 153 6 59 E18
YWG WINNIPEGINTERNATIONAL WINNIPEG CANADA 49 54 36 N 97 14 4 W783
MCC MCCLELLAN SACRAMENTO USA 38 40 3 N 121 24 2 W 75
HND TOKYOINTERNATIONAL TOKYO JAPAN 35 33 8 N 139 46 46 E 35
VIX GOIABEIRAS VITORIA BRAZIL 20 15 20 S 40 17 20 W 11
YHY HAYRIVER HAYRIVER CANADA 60 50 23 N 115 46 58 W 543
CAE COLUMBIAMETROPOLITAN COLOMBIA USA 33 56 19 N 81 7 10 W236
GMP GIMPO SEOUL KOREA 37 33 29 N 126 47 26 E 58
YEU EUREKA EUREKA CANADA 79 59 41 N 85 48 48 W 256
MNL MALABANG MANILA PHILIPPINES 7 37 2 N 124 3 31 E 27
QPG PAYALEBAR PAYALEBAR SINGAPORE 1 21 37 N 103 54 34 E 65
VDZ VALDEZPIONEERFIELD VALDEZ USA 61 8 2 N 146 14 54 W 120
RCO STAGNANT ROCHEFORT FRANCE 45 53 16 N 0 58 59 W 56
JGA JAMNAGAR JAMNAGAR INDIA 22 27 59 N 70 0 41 E 69
hash(key) = (∑i=0nkey(i)⋅17)%TableSize,where key(i) is the ith character of thekey.
As an example if we are to hash AES , hash("AES")= ( A*17 + E* 17 + S* 17) % 19 = (65*17 +69*17+83*17) %19 = 3689 % 19 = 3, thus the record with key AES should be insertedinto the queue at index 3 of the hash map.
Turn in your hash map showing where each key belongs. Noneed to write out the whole record, just the key issufficient.