From 2cd9e64fd7803550a3a7d7b2970471d834c888c1 Mon Sep 17 00:00:00 2001 From: q23wwwwe Date: Wed, 21 Nov 2018 18:21:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[js]=E5=A2=9E=E5=8A=A0=E6=95=A3=E5=88=97?= =?UTF-8?q?=E8=A1=A8js=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/17_hashmap/HashTable.html | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 javascript/17_hashmap/HashTable.html diff --git a/javascript/17_hashmap/HashTable.html b/javascript/17_hashmap/HashTable.html new file mode 100644 index 0000000..a33f049 --- /dev/null +++ b/javascript/17_hashmap/HashTable.html @@ -0,0 +1,51 @@ + + + + + Title + + + + + From bf6e98f00d53dfcc2127cbaeab03525ee187fd04 Mon Sep 17 00:00:00 2001 From: q23wwwwe Date: Wed, 21 Nov 2018 23:11:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[js]=E5=A2=9E=E5=8A=A0=E6=95=A3=E5=88=97?= =?UTF-8?q?=E8=A1=A8js=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/17_hashmap/HashTable.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/javascript/17_hashmap/HashTable.html b/javascript/17_hashmap/HashTable.html index a33f049..cd7cfe0 100644 --- a/javascript/17_hashmap/HashTable.html +++ b/javascript/17_hashmap/HashTable.html @@ -22,7 +22,7 @@ hash+=key.charCodeAt(i); } //为了得到比较小的数值,我们会用hash和任意数除余 - return hash%37; + return hash%30; } //向散列表增加一个新的项 put(key,value){ @@ -38,6 +38,13 @@ get(key){ console.log(this.table[this.loseHashCode(key)]) } + print(){ + for (var i=0;i From 31bab478b32231a80d73eb28c62e388b3521c623 Mon Sep 17 00:00:00 2001 From: q23wwwwe Date: Thu, 22 Nov 2018 20:22:09 +0800 Subject: [PATCH 3/3] Update HashTable.html --- javascript/17_hashmap/HashTable.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/17_hashmap/HashTable.html b/javascript/17_hashmap/HashTable.html index cd7cfe0..de04606 100644 --- a/javascript/17_hashmap/HashTable.html +++ b/javascript/17_hashmap/HashTable.html @@ -22,7 +22,7 @@ hash+=key.charCodeAt(i); } //为了得到比较小的数值,我们会用hash和任意数除余 - return hash%30; + return hash%37; } //向散列表增加一个新的项 put(key,value){