数据结构40-链表get实现
//获取详情方法
LinkList.prototype.get=function(position){
if(position<0||position>=this.length) return null
//获取对应的data
var current=this.head
var index=0
while(index<position){
current=current.next
}
return current.data
}

浙公网安备 33010602011771号