The variables that this list will be choosing from is: <br>
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^*(),./;'\[]}{|:?><
Random List<br/>
<div id="output1"></div>
<br/>Hash List<br/>
<div id="output2"></div>
<br/> Sort Hash List <br/>
<div id="output3"></div>
JavaScript
var list = new List();
var indexes = [];
function Node(_contentA, _contentB) {
this.contentA = _contentA;
this.contentB = _contentB;
this.source = null;
this.next = null;
this.last = null;
return this;
}
function List() {
this.bottom = null;
this.top = null;
this.length = 0;
this.push = function(_contentA, _contentB) {
if (this.bottom == null) {
this.bottom = new Node(_contentA, _contentB);
this.top = this.bottom;
this.length++;
return this;
}
else {
var addedNode = new Node(_contentA, _contentB);
addedNode.last = this.top;
this.top.next = addedNode;
this.top = addedNode;
this.length++;
return this;
}
}
this.contentAtoString = function() {
var str = "";
var node = this.bottom;
while (node != null) {
str += node.contentA + " ";
node = node.next;
}
return str;
}
this.toString = function() {
var str = "";
var node = this.bottom;
while (node != null) {
str += node.contentA + " " + node.contentB + "<br>";
node = node.next;
}
return str;
}
}
List.prototype.create = function() {
var n = 10;
var node = this.bottom;
for (var i = 1; i <= n; i++) {
this.push(randomString());
}
document.getElementById("output1").innerHTML += this.contentAtoString();
}
List.prototype.hash = function() {
node = this.bottom;
while (node != null) {
node.contentB = djb2Hash(node.contentA);
node.source = node.contentA;
node = node.next;
}
document.getElementById("output2").innerHTML += this.toString();
}
List.prototype.copytoArray = function() {
var node = this.bottom;
var i = 0;
while (node != null) {
indexes[i] =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.