题解 | #从尾到头打印链表#

从尾到头打印链表

http://www.nowcoder.com/practice/d0267f7f55b3412ba93bd35cfa8e8035

function printListFromTailToHead(head)
{
    
    if(head){
        if(head.next!=null){
            printListFromTailToHead(head.next)
        }
        res.push(head.val)
    }
    return res
}
module.exports = {
    printListFromTailToHead : printListFromTailToHead
};

js递归

全部评论

相关推荐

我还没笔试呢?怎么灰了??收到你们笔试了呀?
牛牛想要一份工作:别慌佬,灰了只是表示这个岗位停止投递了,跟你的进度没关系,正常笔试就好
投递vivo等公司10个岗位 > 牛客创作赏金赛
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务