Question : add method in hash table
Answered by : mohammad-alshraideh
add(key, value) { let hash = this._hash(key); if (!this.buckets[hash]) { this.buckets[hash] = new LinkedList(); } let data = { [key]: value }; this.buckets[hash].insert(data); }
Source : | Last Update : Tue, 06 Sep 22