//获取详情方法
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
}
微信扫一扫
//获取详情方法
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
}
相关推荐