2021年6月14日
摘要: 二叉树的中序、前序、后序遍历 给定一个二叉树的根节点 root ,返回它的 中序 前序 后序遍历: var orderTraversal = function(root){ const res = []; const order = (root)=>{ if(root!=null){ // res. 阅读全文
posted @ 2021-06-14 23:03 BillGates-- 阅读(66) 评论(0) 推荐(0)
摘要: 206. 反转链表 1 迭代法反转: var reverseList = function(head){ let prev = null; let curr = head; while(curr){ const next = curr.next; curr.next = prev; prev = c 阅读全文
posted @ 2021-06-14 22:55 BillGates-- 阅读(67) 评论(0) 推荐(0)