作者:Liao_Hong_XiDian 来源:CSDN 原文:https://blog.csdn.net/qq_23523409/article/details/85232742 版权声明:本文为博主原创文章,转载请附上…
标签:LeetCode
LeetCode:950.按递增顺序显示卡牌
输入:[17,13,11,2,3,5,7] 输出:[2,13,3,11,5,17,7] 解释: 我们得到的牌组顺序为 [17,13,11,2,3,5,7](这个顺序不重要),然后将其重新排序。 重新排序后,牌组以 [2,…
LeetCode:48.旋转图像
给定一个 n × n 的二维矩阵表示一个图像。将图像顺时针旋转 90 度。说明:你必须在原地旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要使用另一个矩阵来旋转图像。 示例 1: 给定 matrix = [ [1,…
leetcode: 105. 从前序与中序遍历序列构造二叉树
从图中看出的最重要的一点是前序序列怎末划分成两部分。其实可以先在中序中找出左边有n个元素,然后前序除了第一个头节点之后的n个元素就是左子树上的前序序列。另外的就是右子树的前序序列。 注意上图中前序中序分块的颜色匹配。
leetcode 二叉树前序遍历的递归和非递归实现
Given a binary tree, return the preorder traversal of its nodes’ values. For example:Given bin…
leetcode 二叉树前序遍历的递归和非递归实现
Given a binary tree, return the preorder traversal of its nodes’ values. For example:Given bin…
leetcode508. Most Frequent Subtree Sum
题目要求 Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node …
LRU Cache的实现
LeetCode 146 LRU Cache 我的LeetCode题解GitHub链接https://github.com/YuanSun927/LeetCode,欢迎交流! 1. 题目描述 Design and imp…
LeetCode 边学python边练算法(持续更新)
LeetCode 边学python边练算法(持续更新) LeetCode 边学python边练算法(持续更新) 1、两数之和 我的代码 知识点 字典 数组 2、两数相加 我的代码 知识点 结构体 3、无重复字符的最长子串…
Leetcode_Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has e…
Leetcode_Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single charac…
Leetcode_Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: …