字符串 & 数学 & 其它
摘要:剑指 Offer 38. 字符串的排列:https://leetcode-cn.com/problems/zi-fu-chuan-de-pai-lie-lcof/ 点击查看代码 // 思想:从剩余可选字符中填充指定位置,直到所有位置填充完成 // 注意String和char[]互转;ArrayLis
阅读全文
二叉树-递归思想-非递归遍历 & 栈 & 队列 & 链表
摘要:二叉树的前序遍历:https://leetcode-cn.com/problems/binary-tree-preorder-traversal/ 点击查看代码 // 二叉树的递归遍历 public class Solution { public List<Integer> preorderTrav
阅读全文
数组-排序-贪心-双指针 & HashSet & HashMap & 优先队列(堆)
摘要:42.接雨水:https://leetcode-cn.com/problems/trapping-rain-water/ 点击查看代码 public class Solution { public int trap(int[] height) { int size = height.length;
阅读全文