//以下是一个链表类 function LinkedList(){ //Node表示要加入列表的项 var Node=function(element){ this.element=element; this.next=null; }; var length=0;//存储列表项的数量 var head=null;//head存储的是第一个节点的引用 //向链表尾部追加元素 this.append=function(element){ var node=new Node(element), cur…