@@ -54,22 +54,42 @@ <h1 class="page-title">Source: data-structures/hash-table.js</h1>
5454(function (exports) {
5555 'use strict';
5656
57+ /**
58+ * Constructs a Node to store data and next/prev nodes in Hash table.
59+ *
60+ * @public
61+ * @constructor
62+ * @param {Number|String} key Key of the node.
63+ * @param {Number|String} data Data to be stored in hash table.
64+ */
5765 exports.Node = function (key, data) {
5866 this.key = key;
5967 this.data = data;
6068 this.next = undefined;
6169 this.prev = undefined;
6270 };
6371
72+ /**
73+ * Construct a Hash table..
74+ *
75+ * @public
76+ * @constructor
77+ */
6478 exports.Hashtable = function () {
6579 this.buckets = [];
6680 // The higher the bucket count; less likely for collisions.
6781 this.maxBucketCount = 100;
6882 };
6983
70- /*
71- Using simple non-crypto x-> integer based hash.
72- */
84+ /**
85+ * Simple non-crypto hash used to hash keys, which determines
86+ * while bucket the value will be placed in.
87+ * A javascript implementation of Java's 32bitint hash.
88+ *
89+ * @public
90+ * @method
91+ * @param {Number|String} val Key to be hashed.
92+ */
7393 exports.Hashtable.prototype.hashCode = function (val) {
7494 var i;
7595 var hashCode = 0;
@@ -91,6 +111,14 @@ <h1 class="page-title">Source: data-structures/hash-table.js</h1>
91111 return hashCode;
92112 };
93113
114+ /**
115+ * Puts data into the table based on hashed key value.
116+ *
117+ * @public
118+ * @method
119+ * @param {Number|String} key Key for data.
120+ * @param {Number|String} data Data to be stored in table.
121+ */
94122 exports.Hashtable.prototype.put = function (key, data, hashCode) {
95123 /*
96124 Make collision testing easy with optional hashCode parameter.
@@ -132,6 +160,13 @@ <h1 class="page-title">Source: data-structures/hash-table.js</h1>
132160 newNode.prev = first;
133161 };
134162
163+ /**
164+ * Get's data from the table based on key.
165+ *
166+ * @public
167+ * @method
168+ * @param {Number|String} key Key for data to be retrieved.
169+ */
135170 exports.Hashtable.prototype.get = function (key, hashCode) {
136171 /*
137172 Make collision testing easy with optional hashCode parameter.
@@ -171,6 +206,13 @@ <h1 class="page-title">Source: data-structures/hash-table.js</h1>
171206 }
172207 };
173208
209+ /**
210+ * Removes data from the table based on key.
211+ *
212+ * @public
213+ * @method
214+ * @param {Number|String} key Key of the data to be removed.
215+ */
174216 exports.Hashtable.prototype.remove = function (key, hashCode) {
175217 /*
176218 Make collision testing easy with optional hashCode parameter.
@@ -249,13 +291,13 @@ <h1 class="page-title">Source: data-structures/hash-table.js</h1>
249291</ div >
250292
251293< nav >
252- < h2 > < a href ="index.html "> Home</ a > </ h2 > < h3 > Modules</ h3 > < ul > < li > < a href ="module-combinatorics_cartesianproduct.html "> combinatorics/cartesianproduct</ a > </ li > < li > < a href ="module-combinatorics_combinations.html "> combinatorics/combinations</ a > </ li > < li > < a href ="module-combinatorics_permutations.html "> combinatorics/permutations</ a > </ li > < li > < a href ="module-combinatorics_variations-repetition.html "> combinatorics/variations-repetition</ a > </ li > < li > < a href ="module-data-structures_avl-tree.html "> data-structures/avl-tree</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.html "> data-structures/binary-search-tree</ a > </ li > < li > < a href ="module-data-structures_edge.html "> data-structures/edge</ a > </ li > < li > < a href ="module-data-structures_hash-table.html "> data-structures/hash-table</ a > </ li > < li > < a href ="module-data-structures_heap.html "> data-structures/heap</ a > </ li > < li > < a href ="module-data-structures_interval-tree.html "> data-structures/interval-tree</ a > </ li > < li > < a href ="module-data-structures_linked-list.html "> data-structures/linked-list</ a > </ li > < li > < a href ="module-data-structures_red-black-tree.html "> data-structures/red-black-tree</ a > </ li > < li > < a href ="module-data-structures_splay-tree.html "> data-structures/splay-tree</ a > </ li > < li > < a href ="module-data-structures_vertex.html "> data-structures/vertex</ a > </ li > < li > < a href ="module-graphs_others_topological-sort.html "> graphs/others/topological-sort</ a > </ li > < li > < a href ="module-graphs_searching_bfs.html "> graphs/searching/bfs</ a > </ li > < li > < a href ="module-graphs_searching_dfs.html "> graphs/searching/dfs</ a > </ li > < li > < a href ="module-graphs_shortest-path_bellman-ford.html "> graphs/shortest-path/bellman-ford</ a > </ li > < li > < a href ="module-graphs_shortest-path_dijkstra.html "> graphs/shortest-path/dijkstra</ a > </ li > < li > < a href ="module-graphs_shortest-path_floyd-warshall.html "> graphs/shortest-path/floyd-warshall</ a > </ li > < li > < a href ="module-graphs_spanning-trees_prim.html "> graphs/spanning-trees/prim</ a > </ li > < li > < a href ="module-others_fibonacci.html "> others/fibonacci</ a > </ li > < li > < a href ="module-others_hanoi.html "> others/hanoi</ a > </ li > < li > < a href ="module-others_levenshtein-distance.html "> others/levenshtein-distance</ a > </ li > < li > < a href ="module-others_minCoinsChange.html "> others/minCoinsChange</ a > </ li > < li > < a href ="module-primes_is-prime.html "> primes/is-prime</ a > </ li > < li > < a href ="module-primes_prime-factor-tree.html "> primes/prime-factor-tree</ a > </ li > < li > < a href ="module-primes_sieve-of-eratosthenes.html "> primes/sieve-of-eratosthenes</ a > </ li > < li > < a href ="module-searching_binarysearch.html "> searching/binarysearch</ a > </ li > < li > < a href ="module-searching_knuth-morris-pratt.html "> searching/knuth-morris-pratt</ a > </ li > < li > < a href ="module-searching_longest-increasing-subsequence.html "> searching/longest-increasing-subsequence</ a > </ li > < li > < a href ="module-searching_maximum-subarray.html "> searching/maximum-subarray</ a > </ li > < li > < a href ="module-searching_maximum-subarray-divide-and-conquer.html "> searching/maximum-subarray-divide-and-conquer</ a > </ li > < li > < a href ="module-searching_quickselect.html "> searching/quickselect</ a > </ li > < li > < a href ="module-searching_recursive-binarysearch.html "> searching/recursive-binarysearch</ a > </ li > < li > < a href ="module-sets_quickfind.html "> sets/quickfind</ a > </ li > < li > < a href ="module-sets_quickunion.html "> sets/quickunion</ a > </ li > < li > < a href ="module-sets_weightquickunion.html "> sets/weightquickunion</ a > </ li > < li > < a href ="module-shuffle_fisheryates.html "> shuffle/fisheryates</ a > </ li > < li > < a href ="module-shuffle_richarddurstenfeld.html "> shuffle/richarddurstenfeld</ a > </ li > < li > < a href ="module-sorting_3-way-string-quicksort.html "> sorting/3-way-string-quicksort</ a > </ li > < li > < a href ="module-sorting_bubblesort.html "> sorting/bubblesort</ a > </ li > < li > < a href ="module-sorting_bucketsort.html "> sorting/bucketsort</ a > </ li > < li > < a href ="module-sorting_countingsort.html "> sorting/countingsort</ a > </ li > < li > < a href ="module-sorting_heapsort.html "> sorting/heapsort</ a > </ li > < li > < a href ="module-sorting_insertion-binary-sort.html "> sorting/insertion-binary-sort</ a > </ li > < li > < a href ="module-sorting_insertionsort.html "> sorting/insertionsort</ a > </ li > < li > < a href ="module-sorting_lsd.html "> sorting/lsd</ a > </ li > < li > < a href ="module-sorting_mergesort.html "> sorting/mergesort</ a > </ li > < li > < a href ="module-sorting_mergesort_merge.html "> sorting/mergesort/merge</ a > </ li > < li > < a href ="module-sorting_msd.html "> sorting/msd</ a > </ li > < li > < a href ="module-sorting_oddeven-sort.html "> sorting/oddeven-sort</ a > </ li > < li > < a href ="module-sorting_quicksort-middle.html "> sorting/quicksort-middle</ a > </ li > < li > < a href ="module-sorting_recursive-insertionsort.html "> sorting/recursive-insertionsort</ a > </ li > < li > < a href ="module-sorting_selectionsort.html "> sorting/selectionsort</ a > </ li > < li > < a href ="module-sorting_shellsort.html "> sorting/shellsort</ a > </ li > </ ul > < h3 > Classes</ h3 > < ul > < li > < a href ="module-data-structures_avl-tree.AVLTree.html "> AVLTree</ a > </ li > < li > < a href ="module-data-structures_avl-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.BinaryTree.html "> BinaryTree</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_heap.Heap.html "> Heap</ a > </ li > < li > < a href ="module-data-structures_interval-tree.IntervalTree.html "> IntervalTree</ a > </ li > < li > < a href ="module-data-structures_interval-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_linked-list.LinkedList.html "> LinkedList</ a > </ li > < li > < a href ="module-data-structures_linked-list.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_red-black-tree.RBTree.html "> RBTree</ a > </ li > < li > < a href ="module-data-structures_splay-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_splay-tree.SplayTree.html "> SplayTree</ a > </ li > < li > < a href ="module-graphs_spanning-trees_prim.Graph.html "> Graph</ a > </ li > < li > < a href ="module-sets_quickfind.QuickFind.html "> QuickFind</ a > </ li > < li > < a href ="module-sets_quickunion.QuickUnion.html "> QuickUnion</ a > </ li > < li > < a href ="module-sets_weightquickunion.QuickUnion.html "> QuickUnion</ a > </ li > </ ul >
294+ < h2 > < a href ="index.html "> Home</ a > </ h2 > < h3 > Modules</ h3 > < ul > < li > < a href ="module-combinatorics_cartesianproduct.html "> combinatorics/cartesianproduct</ a > </ li > < li > < a href ="module-combinatorics_combinations.html "> combinatorics/combinations</ a > </ li > < li > < a href ="module-combinatorics_permutations.html "> combinatorics/permutations</ a > </ li > < li > < a href ="module-combinatorics_variations-repetition.html "> combinatorics/variations-repetition</ a > </ li > < li > < a href ="module-data-structures_avl-tree.html "> data-structures/avl-tree</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.html "> data-structures/binary-search-tree</ a > </ li > < li > < a href ="module-data-structures_edge.html "> data-structures/edge</ a > </ li > < li > < a href ="module-data-structures_hash-table.html "> data-structures/hash-table</ a > </ li > < li > < a href ="module-data-structures_heap.html "> data-structures/heap</ a > </ li > < li > < a href ="module-data-structures_interval-tree.html "> data-structures/interval-tree</ a > </ li > < li > < a href ="module-data-structures_linked-list.html "> data-structures/linked-list</ a > </ li > < li > < a href ="module-data-structures_red-black-tree.html "> data-structures/red-black-tree</ a > </ li > < li > < a href ="module-data-structures_splay-tree.html "> data-structures/splay-tree</ a > </ li > < li > < a href ="module-data-structures_vertex.html "> data-structures/vertex</ a > </ li > < li > < a href ="module-graphs_others_topological-sort.html "> graphs/others/topological-sort</ a > </ li > < li > < a href ="module-graphs_searching_bfs.html "> graphs/searching/bfs</ a > </ li > < li > < a href ="module-graphs_searching_dfs.html "> graphs/searching/dfs</ a > </ li > < li > < a href ="module-graphs_shortest-path_bellman-ford.html "> graphs/shortest-path/bellman-ford</ a > </ li > < li > < a href ="module-graphs_shortest-path_dijkstra.html "> graphs/shortest-path/dijkstra</ a > </ li > < li > < a href ="module-graphs_shortest-path_floyd-warshall.html "> graphs/shortest-path/floyd-warshall</ a > </ li > < li > < a href ="module-graphs_spanning-trees_prim.html "> graphs/spanning-trees/prim</ a > </ li > < li > < a href ="module-others_fibonacci.html "> others/fibonacci</ a > </ li > < li > < a href ="module-others_hanoi.html "> others/hanoi</ a > </ li > < li > < a href ="module-others_levenshtein-distance.html "> others/levenshtein-distance</ a > </ li > < li > < a href ="module-others_minCoinsChange.html "> others/minCoinsChange</ a > </ li > < li > < a href ="module-primes_is-prime.html "> primes/is-prime</ a > </ li > < li > < a href ="module-primes_prime-factor-tree.html "> primes/prime-factor-tree</ a > </ li > < li > < a href ="module-primes_sieve-of-eratosthenes.html "> primes/sieve-of-eratosthenes</ a > </ li > < li > < a href ="module-searching_binarysearch.html "> searching/binarysearch</ a > </ li > < li > < a href ="module-searching_knuth-morris-pratt.html "> searching/knuth-morris-pratt</ a > </ li > < li > < a href ="module-searching_longest-increasing-subsequence.html "> searching/longest-increasing-subsequence</ a > </ li > < li > < a href ="module-searching_maximum-subarray.html "> searching/maximum-subarray</ a > </ li > < li > < a href ="module-searching_maximum-subarray-divide-and-conquer.html "> searching/maximum-subarray-divide-and-conquer</ a > </ li > < li > < a href ="module-searching_quickselect.html "> searching/quickselect</ a > </ li > < li > < a href ="module-searching_recursive-binarysearch.html "> searching/recursive-binarysearch</ a > </ li > < li > < a href ="module-sets_quickfind.html "> sets/quickfind</ a > </ li > < li > < a href ="module-sets_quickunion.html "> sets/quickunion</ a > </ li > < li > < a href ="module-sets_weightquickunion.html "> sets/weightquickunion</ a > </ li > < li > < a href ="module-shuffle_fisheryates.html "> shuffle/fisheryates</ a > </ li > < li > < a href ="module-shuffle_richarddurstenfeld.html "> shuffle/richarddurstenfeld</ a > </ li > < li > < a href ="module-sorting_3-way-string-quicksort.html "> sorting/3-way-string-quicksort</ a > </ li > < li > < a href ="module-sorting_bubblesort.html "> sorting/bubblesort</ a > </ li > < li > < a href ="module-sorting_bucketsort.html "> sorting/bucketsort</ a > </ li > < li > < a href ="module-sorting_countingsort.html "> sorting/countingsort</ a > </ li > < li > < a href ="module-sorting_heapsort.html "> sorting/heapsort</ a > </ li > < li > < a href ="module-sorting_insertion-binary-sort.html "> sorting/insertion-binary-sort</ a > </ li > < li > < a href ="module-sorting_insertionsort.html "> sorting/insertionsort</ a > </ li > < li > < a href ="module-sorting_lsd.html "> sorting/lsd</ a > </ li > < li > < a href ="module-sorting_mergesort.html "> sorting/mergesort</ a > </ li > < li > < a href ="module-sorting_mergesort_merge.html "> sorting/mergesort/merge</ a > </ li > < li > < a href ="module-sorting_msd.html "> sorting/msd</ a > </ li > < li > < a href ="module-sorting_oddeven-sort.html "> sorting/oddeven-sort</ a > </ li > < li > < a href ="module-sorting_quicksort-middle.html "> sorting/quicksort-middle</ a > </ li > < li > < a href ="module-sorting_recursive-insertionsort.html "> sorting/recursive-insertionsort</ a > </ li > < li > < a href ="module-sorting_selectionsort.html "> sorting/selectionsort</ a > </ li > < li > < a href ="module-sorting_shellsort.html "> sorting/shellsort</ a > </ li > </ ul > < h3 > Classes</ h3 > < ul > < li > < a href ="module-data-structures_avl-tree.AVLTree.html "> AVLTree</ a > </ li > < li > < a href ="module-data-structures_avl-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.BinaryTree.html "> BinaryTree</ a > </ li > < li > < a href ="module-data-structures_binary-search-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_hash-table.Hashtable.html "> Hashtable</ a > </ li > < li > < a href ="module-data-structures_hash-table.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_heap.Heap.html "> Heap</ a > </ li > < li > < a href ="module-data-structures_interval-tree.IntervalTree.html "> IntervalTree</ a > </ li > < li > < a href ="module-data-structures_interval-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_linked-list.LinkedList.html "> LinkedList</ a > </ li > < li > < a href ="module-data-structures_linked-list.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_red-black-tree.RBTree.html "> RBTree</ a > </ li > < li > < a href ="module-data-structures_splay-tree.Node.html "> Node</ a > </ li > < li > < a href ="module-data-structures_splay-tree.SplayTree.html "> SplayTree</ a > </ li > < li > < a href ="module-graphs_spanning-trees_prim.Graph.html "> Graph</ a > </ li > < li > < a href ="module-sets_quickfind.QuickFind.html "> QuickFind</ a > </ li > < li > < a href ="module-sets_quickunion.QuickUnion.html "> QuickUnion</ a > </ li > < li > < a href ="module-sets_weightquickunion.QuickUnion.html "> QuickUnion</ a > </ li > </ ul >
253295</ nav >
254296
255297< br class ="clear ">
256298
257299< footer >
258- Documentation generated by < a href ="https://github.com/jsdoc3/jsdoc "> JSDoc 3.3.0-alpha13 </ a > on Mon Jul 13 2015 16: 17:46 GMT+0300 (EEST )
300+ Documentation generated by < a href ="https://github.com/jsdoc3/jsdoc "> JSDoc 3.3.2 </ a > on Wed Jul 15 2015 17:47:03 GMT-0500 (Central Daylight Time )
259301</ footer >
260302
261303< script > prettyPrint ( ) ; </ script >
0 commit comments