随笔分类 - LeetCode(Java)
摘要:LeetCode 105. Construct Binary Tree from Preorder and Inorder Traversal (从前序与中序遍历序列构造二叉树) 题目 链接 https://leetcode-cn.com/problems/construct-binary-tree
阅读全文
摘要:LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal (从中序与后序遍历序列构造二叉树) 题目 链接 https://leetcode-cn.com/problems/construct-binary-tre
阅读全文
摘要:LeetCode 889. Construct Binary Tree from Preorder and Postorder Traversal (根据前序和后序遍历构造二叉树) 题目 链接 https://leetcode-cn.com/problems/construct-binary-tre
阅读全文
摘要:LeetCode 654. Maximum Binary Tree (最大二叉树) 题目 链接 https://leetcode-cn.com/problems/maximum-binary-tree/ 问题描述 给定一个不重复的整数数组 nums 。 最大二叉树 可以用下面的算法从 nums 递归
阅读全文
摘要:LeetCode 114. Flatten Binary Tree to Linked List (二叉树展开为链表) 题目 链接 https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/ 问题描述 给你二叉树的根结点
阅读全文
摘要:LeetCode 116. Populating Next Right Pointers in Each Node (填充每个节点的下一个右侧节点指针) 题目 链接 https://leetcode-cn.com/problems/populating-next-right-pointers-in-
阅读全文
摘要:LeetCode 239. Sliding Window Maximum (滑动窗口最大值) 题目 链接 https://leetcode-cn.com/problems/sliding-window-maximum/ 问题描述 给你一个整数数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧
阅读全文
摘要:LeetCode 739. Daily Temperatures (每日温度) 题目 链接 https://leetcode-cn.com/problems/daily-temperatures/ 问题描述 给定一个整数数组 temperatures ,表示每天的温度,返回一个数组 answer ,
阅读全文
摘要:LeetCode 503. Next Greater Element II (下一个更大元素 II) 题目 链接 https://leetcode-cn.com/problems/next-greater-element-ii/ 问题描述 给定一个循环数组 nums ( nums[nums.leng
阅读全文
摘要:LeetCode 496. Next Greater Element I (下一个更大元素 I) 题目 链接 https://leetcode-cn.com/problems/next-greater-element-i/ 问题描述 nums1 中数字 x 的 下一个更大元素 是指 x 在 nums
阅读全文
摘要:LeetCode 682. Baseball Game (棒球比赛) 题目 链接 https://leetcode-cn.com/problems/baseball-game/ 问题描述 你现在是一场采用特殊赛制棒球比赛的记录员。这场比赛由若干回合组成,过去几回合的得分可能会影响以后几回合的得分。
阅读全文
摘要:LeetCode 1541. Minimum Insertions to Balance a Parentheses String (平衡括号字符串的最少插入次数) 题目 链接 https://leetcode-cn.com/problems/minimum-insertions-to-balanc
阅读全文
摘要:LeetCode 921. Minimum Add to Make Parentheses Valid (使括号有效的最少添加) 题目 链接 https://leetcode-cn.com/problems/minimum-add-to-make-parentheses-valid/ 问题描述 只有
阅读全文
摘要:LeetCode 225. Implement Stack using Queues (用队列实现栈) 题目 链接 https://leetcode-cn.com/problems/implement-stack-using-queues/ 问题描述 请你仅使用两个队列实现一个后入先出(LIFO)的
阅读全文
摘要:LeetCode 232. Implement Queue using Stacks (用栈实现队列) 题目 链接 https://leetcode-cn.com/problems/implement-queue-using-stacks/ 问题描述 请你仅使用两个栈实现先入先出队列。队列应当支持一
阅读全文
摘要:LeetCode 92. Reverse Linked List II (反转链表 II) 题目 链接 https://leetcode-cn.com/problems/reverse-linked-list-ii/ 问题描述 给你单链表的头指针 head 和两个整数 left 和 right ,其
阅读全文
摘要:LeetCode 141. Linked List Cycle (环形链表) 题目 链接 https://leetcode-cn.com/problems/linked-list-cycle/ 问题描述 给你一个链表的头节点 head ,判断链表中是否有环。 如果链表中有某个节点,可以通过连续跟踪
阅读全文
摘要:LeetCode 876. Middle of the Linked List (链表的中间结点) 题目 链接 https://leetcode-cn.com/problems/middle-of-the-linked-list/ 问题描述 给定一个头结点为 head 的非空单链表,返回链表的中间结
阅读全文
摘要:LeetCode 19. Remove Nth Node From End of List (删除链表的倒数第 N 个结点) 题目 链接 https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ 问题描述 给你一个链表,删除
阅读全文
摘要:LeetCode 23. Merge k Sorted Lists (合并K个升序链表) 题目 链接 https://leetcode-cn.com/problems/merge-k-sorted-lists/ 问题描述 给你一个链表数组,每个链表都已经按升序排列。 请你将所有链表合并到一个升序链表
阅读全文