Skip to content

Instantly share code, notes, and snippets.

@gvinter
Created June 30, 2011 15:36
Show Gist options
  • Save gvinter/1056493 to your computer and use it in GitHub Desktop.
Save gvinter/1056493 to your computer and use it in GitHub Desktop.
Doubly linked lists - linknode
function make_listnode(prev_list, x, next_list) {
var node = new Object();
node["prev"] = prev_list;
node["value"] = x;
node["next"] = next_list;
return node;
}
var alist = make_listnode (blist, 1, null)
var blist = make_listnode (clist, 2, alist)
var clist = make_listnode (null, 3, blist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment