Created
June 30, 2011 15:36
-
-
Save gvinter/1056493 to your computer and use it in GitHub Desktop.
Doubly linked lists - linknode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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