标签:col sub [] null 链表 pre 返回 var turn
/*function ListNode(x){
this.val = x;
this.next = null;
}*/
function printListFromTailToHead(head)
{
// write code here
var arr = [];
if(head == null){
return arr;
}
while(head != null){
arr.push(head.val);
head = head.next;
}
return arr.reverse();
}
标签:col sub [] null 链表 pre 返回 var turn
原文地址:https://www.cnblogs.com/3yleaves/p/9588575.html