LeetCode 二叉树 善用** ctrl+f** 144. 二叉树的前序遍历 Given a binary tree, return the preorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive solution is trivial, could you do it iteratively? 解法一 递归,没啥好说的 private List<Integer> res=new ArrayList<>(); public List<Integer> preorderTraversal(TreeNode root)
17. 电话号码的字母组合 给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。 给出数字到字母的映射如下(与电话按键相同)注意 1 不对应任何字母
20. 有效的括号 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Note that an empty string is also considered valid. Example 1: Input: "()" Output: true Example 2:
AbstractQueuedSynchronized AbstractQueuedSynchronized 简称 AQS,这个类是整个并发包的基础工具类, ReentrantLock、CountDownLatch、Semaphore、FutureT
1. 两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会
这一篇主要记录 JVM 相关的 Class 文件结构 Class 类文件的结构 Class 文件是一组以** 8 个字节**为基础单位的二进制流,根据 Java 虚拟机规范,Class 文件格式采用一
70. 爬楼梯 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a positive integer. Example 1: Input: 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step
这一篇主要讲 JVM 的类加载机制,本来很久之前就写了,但是这几天又重新学习了一遍,纠正了之前很多错误的观点,然后又补充了很多东西 类加载的过程 前言: