JS算法总结 Posted on 2023-11-25 Edited on 2023-11-27 In 技术 , 算法 JS算法总结链表题 链表转数组 场景:要使用栈方法时 123456var isPalindrome = function (head) { const vals = []; while (head !== null) { vals.push(head.val)//压入值,把链表转化为数组 head = head.next }