上一页 1 2 3 4 5 6 7 ··· 10 下一页
2021年11月23日
摘要: 题目 二叉树zigzag遍历 层次遍历:始终左右 zigzag遍历:每层右左左右交替 Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from 阅读全文
posted @ 2021-11-23 05:34 alau 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 题目 与543相似,543是求最长路径,这是最大权重求和(路径不一定最长) A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge con 阅读全文
posted @ 2021-11-23 04:45 alau 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目 二叉树的直径,即是求树中任意俩点间的最大距离(深度) Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the len 阅读全文
posted @ 2021-11-23 04:24 alau 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 题目 删除链表head中倒数第N个元素 Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3 阅读全文
posted @ 2021-11-23 01:13 alau 阅读(26) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/3cd3f2023ac4 https://www.bilibili.com/video/BV1pr4y1c7B8 与AND & 两个1,即为1 或OR | 只要有一个1,即为1 亦或XOR ^ 相同为0,不同为1(不进位加法,0+0=0,1+0=1 阅读全文
posted @ 2021-11-23 00:49 alau 阅读(22) 评论(0) 推荐(0) 编辑
2021年11月22日
摘要: 不消耗额外空间的前提下,将数字向前移向。 https://www.bilibili.com/video/BV1Pv4y1Z76N 阅读全文
posted @ 2021-11-22 07:30 alau 阅读(28) 评论(0) 推荐(0) 编辑
2021年9月4日
摘要: 【题目】 一串int数组中找到乘积最大的子串,子串必须连续,返回成绩ans Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, 阅读全文
posted @ 2021-09-04 17:46 alau 阅读(31) 评论(0) 推荐(0) 编辑
2021年8月31日
摘要: 【题目】 将链表组成的数相加 leetcode2变式,2题是高位在后,现在是高位在前节点 You are given two non-empty linked lists representing two non-negative integers. The most significant dig 阅读全文
posted @ 2021-08-31 17:11 alau 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 【题目】 反转链表是之后很多题的基础 把链表12345反转成54321 Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [ 阅读全文
posted @ 2021-08-31 16:51 alau 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 【题目】 将两个用list存储的数字相加,返回相加后的值 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, 阅读全文
posted @ 2021-08-31 14:31 alau 阅读(26) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页