- 博客(374)
- 资源 (4)
- 收藏
- 关注
原创 Tomcat 第二篇:启动流程
1 Tomcat 基本知识首先介绍一些 Tomcat 的基本知识,防止有纯小白看的云里雾里的。下面这张图是一个下载好二进制版的的 Tomcat ,直接解压得到的,虽然版本是 9.x ,但是这个目录结构和 8.5 是一致的,不影响介绍。bin : 主要用来存放一些脚本文件,一种格式是 sh 的是在 Linux 使用的脚本,另一种格式是 bat 的是在 Windows 中使用的脚本。conf : 主要用来存放一些 Tomcat 的配置文件,有 xml 格式的也有 properties 格式的。l.
2020-09-18 08:54:56 424
原创 每日一道 LeetCode (47):寻找两个正序数组的中位数
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:寻找两个正序数组的中位数难度:困难题目来源:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/solution/xiang-xi-tong-su-de-s..
2020-09-17 09:35:18 216
原创 每日一道 LeetCode (46):无重复字符的最长子串
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:无重复字符的最长子串题目来源:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/给定一个字符串,请你找出其中不含有重..
2020-09-16 09:00:16 212
原创 Tomcat 第一篇:源码导入 IDEA 编辑器
1 引言做 Java 的同学应该都见过上面这只名字叫 Tomcat 的猫,毕竟这只猫在过去和现在都是全球最流行的 Web 容器之一。很有意思的一件事儿是从我接触这只猫开始,从来不知道它的中文名字是啥,好像没有在任何地方看到过。然后某人第一次见跟我说这是汤姆猫么???我就没想通,这俩玩意长这么大差距是如何能被认成是同一只猫的。不过话说回来,这东西我也接触了有很多年了,从来都只是拿来用,忽然有想法深入了解下 Tomcat 的运行机制了。那么最好的方式就是看源码,如果说看源码不知道从哪看齐,还可以.
2020-09-15 09:11:48 372
原创 每日一道 LeetCode (45):两数相加
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:两数相加题目来源:https://leetcode-cn.com/problems/add-two-numbers/给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节..
2020-09-14 09:00:30 202
原创 每日一道 LeetCode (44):位1的个数
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:位 1 的个数题目来源:https://leetcode-cn.com/problems/number-of-1-bits/编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(也被称为汉明重量)..
2020-09-12 08:04:48 220
原创 每日一道 LeetCode (43):翻转二进制数
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:翻转二进制数题目来源:https://leetcode-cn.com/problems/reverse-bits/颠倒给定的 32 位无符号整数的二进制位。示例 1:输入: 000000101001010000011110..
2020-09-11 09:03:39 584
原创 每日一道 LeetCode (42):旋转数组
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:旋转数组题目来源:https://leetcode-cn.com/problems/rotate-array/给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。示例 1:输入: [1,2,3,4,5,6..
2020-09-10 08:55:41 260
原创 每日一道 LeetCode (41):阶乘后的零
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:阶乘后的零给定一个整数 n,返回 n! 结果尾数中零的数量。示例 1:输入: 3输出: 0解释: 3! = 6, 尾数中没有零。示例 2:输入: 5输出: 1解释: 5! = 120, 尾数中有 1 个零...
2020-09-09 09:10:27 192
原创 每日一道 LeetCode (40):Excel表列序号
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:Excel表列序号题目来源:https://leetcode-cn.com/problems/excel-sheet-column-number/给定一个Excel表格中的列名称,返回其相应的列序号。例如, A -&..
2020-09-08 08:56:31 214
原创 每日一道 LeetCode (39):多数元素
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:每日一道 LeetCode (39):多数元素题目来源:https://leetcode-cn.com/problems/majority-element/给定一个大小为 n 的数组,找到其中的多数元素。多数元素是指在数组中出..
2020-09-07 08:42:54 199
原创 每日一道 LeetCode (38):Excle 表列名称
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:Excle 表列名称题目来源:https://leetcode-cn.com/problems/excel-sheet-column-title/给定一个正整数,返回它在 Excel 表中相对应的列名称。例如, 1 ..
2020-09-06 13:03:41 190
原创 每日一道 LeetCode (37):两数之和 II - 输入有序数组
每日一道 LeetCode (37):两数之和 II - 输入有序数组每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:两数之和 II - 输入有序数组题目来源:https://leetcode-cn.com/problems/two-sum-ii-input-array-i
2020-09-05 09:44:51 273
原创 每日一道 LeetCode (36):相交链表
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:最小栈题目来源:https://leetcode-cn.com/problems/intersection-of-two-linked-lists/solution/chang-lian-biao-xian-zou-ji-bu-..
2020-09-04 09:05:08 185
原创 每日一道 LeetCode (35):最小栈
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:最小栈题目来源:https://leetcode-cn.com/problems/min-stack/设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。push(x) —— 将元素 x 推..
2020-09-03 14:25:44 183
原创 每日一道 LeetCode (34):环形链表
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:环形链表题目来源:https://leetcode-cn.com/problems/linked-list-cycle/submissions/给定一个链表,判断链表中是否有环。为了表示给定链表中的环,我们使用整数 pos ..
2020-09-02 08:56:42 232
原创 每日一道 LeetCode (33):只出现一次的数字
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:只出现一次的数字题目来源:https://leetcode-cn.com/problems/single-number/给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。说..
2020-09-01 14:42:55 211
原创 JVM 第一篇:编译 OpenJdk14 ,我行你也行
本文内容过于硬核,建议有 Java 相关经验人士阅读。1 引言从上周开始一直在看周志明的 「深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)」 ,好多年之前看过第二版的,绝对算的上是国内 JVM 领域的经典之作,值得多读几遍。全书的开头就介绍了如何自己编译一次 JDK ,之前看书的时候直接跳过了,一直都没自己操作过,上周读到这里的时候突然萌生了实践的念头,说搞就搞。首先我这次选用的 OpenJDK ,而不是 OracleJDK , OracleJDK 会有一些独立的商业特性,而这些商..
2020-08-31 08:50:49 1188 5
原创 每日一道 LeetCode (32): 验证回文串
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:验证回文串题目来源:https://leetcode-cn.com/problems/valid-palindrome/solution/yan-zheng-hui-wen-chuan-by-leetcode-solution/..
2020-08-30 13:43:21 173
原创 每日一道 LeetCode (30): 买卖股票的最佳时机
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:买卖股票的最佳时机题目来源:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。如..
2020-08-29 09:52:53 185
原创 每日一道 LeetCode (29):杨辉三角 II
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:杨辉三角题目来源:https://leetcode-cn.com/problems/pascals-triangle-ii/给定一个非负索引 k,其中 k ≤ 33,返回杨辉三角的第 k 行。在杨辉三角中,每个数是它左上方..
2020-08-28 08:57:19 244
原创 每日一道 LeetCode (28):杨辉三角
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:杨辉三角题目来源:https://leetcode-cn.com/problems/pascals-triangle/给定一个非负整数 numRows,生成杨辉三角的前 numRows 行。在杨辉三角中,每个数是它左上方和..
2020-08-27 09:04:17 188
原创 每日一道 LeetCode (27):二叉树的最小深度
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:路径总和题目来源:https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/solution/er-cha-shu-de-zui-xiao-shen-du-by-..
2020-08-26 08:52:23 202
原创 每日一道 LeetCode (26):路径总和
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:路径总和题目来源:https://leetcode-cn.com/problems/path-sum/给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和。说明: 叶子节点..
2020-08-25 12:12:21 168
原创 每日一道 LeetCode (25):平衡二叉树
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:将有序数组转换为二叉搜索树题目来源:https://leetcode-cn.com/problems/balanced-binary-tree/给定一个二叉树,判断它是否是高度平衡的二叉树。本题中,一棵高度平衡二叉树定义为:..
2020-08-24 08:45:30 248
原创 每日一道 LeetCode (24):将有序数组转换为二叉搜索树
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:将有序数组转换为二叉搜索树题目来源:https://leetcode-cn.com/problems/convert-sorted-array-to-binary-search-tree/将一个按照升序排列的有序数组,转换为一..
2020-08-22 10:42:03 210
原创 每日一道 LeetCode (23):二叉树的层次遍历 II
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:二叉树的层次遍历 II题目来源:https://leetcode-cn.com/problems/binary-tree-level-order-traversal-ii/给定一个二叉树,返回其节点值自底向上的层次遍历。 (即..
2020-08-21 08:58:36 197
原创 每日一道 LeetCode (22):二叉树的最大深度
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:二叉树的最大深度题目来源:https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/给定一个二叉树,找出其最大深度。二叉树的深度为根节点到最远叶子节点的最长路..
2020-08-20 09:05:37 256
原创 每日一道 LeetCode (21):对称二叉树
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:对称二叉树题目来源:https://leetcode-cn.com/problems/symmetric-tree/给定一个二叉树,检查它是否是镜像对称的。例如,二叉树 [1,2,2,3,4,4,3] 是对称的。 1..
2020-08-18 08:58:26 204
原创 每日一道 LeetCode (20):相同的树
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:相同的树题目来源:https://leetcode-cn.com/problems/same-tree/给定两个二叉树,编写一个函数来检验它们是否相同。如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。示例..
2020-08-17 09:56:59 186
原创 每日一道 LeetCode (19):合并两个有序数组
每日一道 LeetCode (19):合并两个有序数组每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:合并两个有序数组题目来源:https://leetcode-cn.com/problems/merge-sorted-array/给你两个有序整数数组 nums1 和 n
2020-08-16 14:52:00 336
原创 每日一道 LeetCode (18):删除排序链表中的重复元素
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:删除排序链表中的重复元素题目来源:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/给定一个排序链表,删除所有重复的元素,使得每个元素只出现..
2020-08-15 11:18:00 257
原创 每日一道 LeetCode (17):爬楼梯
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:爬楼梯题目来源:https://leetcode-cn.com/problems/climbing-stairs/solution/pa-lou-ti-by-leetcode-solution/假设你正在爬楼梯。需要 n 阶你..
2020-08-14 08:50:22 286
原创 每日一道 LeetCode (16):求 x 的平方根
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:求 x 的平方根题目来源:https://leetcode-cn.com/problems/sqrtx/实现 int sqrt(int x) 函数。计算并返回 x 的平方根,其中 x 是非负整数。由于返回类型是整数,结果只..
2020-08-13 09:01:37 357
原创 每日一道 LeetCode (15):二进制求和
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:数组加一题目来源:https://leetcode-cn.com/problems/add-binary/给你两个二进制字符串,返回它们的和(用二进制表示)。输入为 非空 字符串且只包含数字 1 和 0。示例 1:输入:..
2020-08-12 09:00:21 186
原创 每日一道 LeetCode (14):数组加一
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:数组加一题目来源:https://leetcode-cn.com/problems/plus-one/给定一个由整数组成的非空数组所表示的非负整数,在该数的基础上加一。最高位数字存放在数组的首位, 数组中每个元素只存储单个数..
2020-08-11 12:13:46 201
原创 每日一道 LeetCode (13):最后一个单词的长度
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:最后一个单词的长度题目来源:https://leetcode-cn.com/problems/length-of-last-word/给定一个仅包含大小写字母和空格 ’ ’ 的字符串 s,返回其最后一个单词的长度。如果字符串从..
2020-08-10 09:42:32 180
原创 每日一道 LeetCode (12):最大子序和
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:最大子序和题目来源:https://leetcode-cn.com/problems/maximum-subarray/solution/zui-da-zi-xu-he-by-leetcode-solution/给定一个整数数..
2020-08-09 10:09:59 243
原创 每日一道 LeetCode (11):外观数列
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:外观数列题目来源:https://leetcode-cn.com/problems/count-and-say/给定一个正整数 n(1 ≤ n ≤ 30),输出外观数列的第 n 项。注意:整数序列中的每一项将表示为一个字符串..
2020-08-08 10:39:15 219
原创 每日一道 LeetCode (10):搜索插入位置
每天 3 分钟,走上算法的逆袭之路。前文合集每日一道 LeetCode 前文合集代码仓库GitHub: https://github.com/meteor1993/LeetCodeGitee: https://gitee.com/inwsy/LeetCode题目:搜索插入位置题目来源:https://leetcode-cn.com/problems/search-insert-position/给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返..
2020-08-07 08:59:38 185
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人