0
点赞
收藏
分享

微信扫一扫

数据结构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
}



举报

相关推荐

0 条评论