随笔分类 - LeetCode
摘要:地址:https://leetcode cn.com/problems/perfect squares/ 大意:给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/binary tree postorder traversal/ 大意:给定一个二叉树,返回它的 后序 遍历。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/binary tree inorder traversal/ 大意:给定一个二叉树,返回它的中序 遍历。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/binary tree preorder traversal/submissions/ 大意:前序遍历一棵树 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/swap nodes in pairs/ 大意:给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/merge two sorted lists/ 大意:将两个升序链表合并为一个新的升序链表并返回。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/remove linked list elements/ 大意:删除链表中等于给定值的所有节点。 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/two sum/ 大意:给定一个整数数组和一个目标值,在该数组中找出和为目标值的两个整数,并返回两个整数的数组下标 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/add two numbers/submissions/ 大意:给定两个链表,返回一个由这两个链表相加而得到的新链表 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/odd even linked list/ 大意:给定一个链表,把所有的奇数节点排在左边,其他排在右边。 要求:时间复杂度O(n) 空间复杂度O(1) ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/longest increasing subsequence/ 大意:给定一个数组,找到最长上升子序列 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/partition list/ 大意:给定一个链表和x,将数值小于x的节点放到左边,其他放右边,保留两个分区中每个节点的初始相对位置 ` `
阅读全文
摘要:地址:https://leetcode cn.com/problems/reverse linked list ii/ 大意:给定一个链表,翻转其中的一部分 解答:
阅读全文