摘要: https://leetcode.cn/problems/rotate-list/solution/xiang-zi-xing-che-lian-yi-yang-qu-xuan-z-di8y/ /** * Definition for singly-linked list. * type ListN 阅读全文
posted @ 2022-07-01 16:30 知道了呀~ 阅读(59) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/solution/236-er-cha-shu-de-zui-jin-gong-gong-zu-xian-hou-xu/ /** * Definition for 阅读全文
posted @ 2022-07-01 15:56 知道了呀~ 阅读(66) 评论(0) 推荐(0) 编辑
摘要: func main() { //按数组层序建立二叉树,之后层序输出二叉树 root:=createTree(0,[]int{1,2,3,4,5,6}) ans:=printTree(root) fmt.Println(ans) //先序建立二叉树,之后先序输出二叉树 var tmp *TreeNod 阅读全文
posted @ 2022-07-01 15:51 知道了呀~ 阅读(185) 评论(2) 推荐(1) 编辑
摘要: https://leetcode.cn/problems/intersection-of-two-linked-lists/solution/xiang-jiao-lian-biao-by-leetcode-solutio-a8jn/ /** * Definition for singly-link 阅读全文
posted @ 2022-07-01 12:07 知道了呀~ 阅读(55) 评论(0) 推荐(0) 编辑