Hashtables
How do I make an hashtables?
What is a hashtables? How do you make a hashtables? This script and codes were developed by Ajala Comfort on 11 January 2023, Wednesday.
Hashtables - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hashtables</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
Hashtables - Script Codes JS Codes
function HashTable(){ this.data = new Array(137),this.values = []; this.Hash = function(stringdata){ const H = 37; var total = 0; for(var i = 0;i < stringdata.length; ++i){ total += H * total + stringdata.charCodeAt(i); } total = total % this.data.length; if(total < 0){total += this.dat.length + 1} return parseInt(total); } this.show = function(){ this.data.forEach(function(val,i){ if(val !== undefined){console.log(i,val)} }) return ; } this.put = function(key,str){ var pos = this.Hash(key); if(this.data[pos] == undefined){ this.values[pos] = key;this.data[pos] = str; return; } while(this.data[pos] !== undefined){pos++;} this.values[pos] = key;this.data[pos] = str;return; } this.get = function(key){ var hash = -1;hash = this.Hash(key); if(hash > -1){ for(var i = hash; this.data[i] !== undefined;i++){ if(this.values[hash] == key){return this.data[hash] + " ; " + this.values[hash]} } } return undefined; }
}
var names = ["David","Jennifer","Donnie","Raymond","Cynthia","Mike","Clayton","Danny","Jonathan"];
var hash = new HashTable();
names.forEach(function(name){hash.put(name.substring(0,2),name)})
//hash.show();
var name = "Comfort";
Developer | Ajala Comfort |
Username | AJALACOMFORT |
Uploaded | January 11, 2023 |
Rating | 3 |
Size | 1,836 Kb |
Views | 4,048 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Second Website | 6,234 Kb |
Palindrome Word | 3,421 Kb |
SVG Clock Practice | 2,436 Kb |
Basic ReactJs Form | 5,214 Kb |
Recipe Book | 4,813 Kb |
Calender Update | 6,157 Kb |
Slide Show with ReactJs | 3,672 Kb |
Material Chat app Interface with ReactJS | 5,851 Kb |
Tic-Tac-Toe Free Code Camp Challenge | 5,214 Kb |
Calculator with ReactJs | 4,475 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Console fun | Dviate | 1,500 Kb |
Animated Logo | Shakdaniel | 2,672 Kb |
Vertical Pan Hammer.js example | Jtangelder | 2,144 Kb |
A Pen by lizz | Lizz | 10,068 Kb |
AngularJS Datalist Directive | M-e-conroy | 2,366 Kb |
Video mute | Leon9208 | 2,131 Kb |
Coming Soon | MariamMassadeh | 1,680 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Cars going | Netoguimaraes | 1,699 Kb |
Base64 SVG Me | MrBambule | 44,786 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!