自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(78)
  • 收藏
  • 关注

原创 LeetCode上数据反转类题目

整数反转https://leetcode-cn.com/problems/reverse-integer/本方法思路及代码来源:作者:wang_ni_ma链接:https://leetcode-cn.com/problems/reverse-integer/solution/tu-jie-7-zheng-shu-fan-zhuan-by-wang_ni_ma/来源:力扣(LeetCode)著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。代码:

2021-05-14 20:01:54 218

原创 牛客上的研发岗最常考对应题目

最长公共子串思路参考这篇博客:https://www.cnblogs.com/fanguangdexiaoyuer/p/11281179.html代码:import java.util.*;public class Solution { /** * longest common substring * @param str1 string字符串 the string * @param str2 string字符串 the stri

2021-05-06 18:25:50 258

原创 LeetCode中的MySQL题目

组合两个表https://leetcode-cn.com/problems/combine-two-tables/select FirstName, LastName, City, Statefrom Person left join Addresson Person.PersonId = Address.PersonId;作者:LeetCode链接:https://leetcode-cn.com/problems/combine-two-tables/solution/

2021-05-04 20:35:39 321

原创 LeetCode高频面试题

LRU缓存机制(medium难度)https://leetcode-cn.com/problems/lru-cache/代码:public class LRUCache { class DLinkedNode { int key; int value; DLinkedNode prev; DLinkedNode next; public DLinkedNode() {}

2021-05-04 14:59:26 231

原创 java输入hasNext()和hasNextLine()方法的区别

https://blog.csdn.net/weixin_36242811/article/details/105463062

2021-04-28 00:11:34 217

原创 LeetCode使用哈希表(或set)的题目整理(待更)

两个数组的交集(simple难度)https://leetcode-cn.com/problems/intersection-of-two-arrays/本题思路方法及代码来源:作者:a-fei-8链接:https://leetcode-cn.com/problems/intersection-of-two-arrays/solution/duo-chong-jie-fa-jie-jue-349-liang-ge-shu-zu-de-ji/来源:力扣(LeetCode)使用set去重

2021-04-23 11:02:04 248

原创 LeetCode中使用双指针法的题目整理(待更)

分段双指针分隔链表(medium难度)https://leetcode-cn.com/problems/partition-list/本方法思路及代码来源:作者:Booooo_链接:https://leetcode-cn.com/problems/partition-list/solution/fen-ge-lian-biao-lian-biao-jiang-yuan-li-2w5t/来源:力扣(LeetCode)解题思路将链表按条件分成两个链表,然后连接起来即可。需要为

2021-04-17 10:45:10 372

原创 LeetCode中关于链表的题目整理(待更)

分段双指针分隔链表(medium难度)https://leetcode-cn.com/problems/partition-list/本方法思路及代码来源:作者:Booooo_链接:https://leetcode-cn.com/problems/partition-list/solution/fen-ge-lian-biao-lian-biao-jiang-yuan-li-2w5t/来源:力扣(LeetCode)解题思路将链表按条件分成两个链表,然后连接起来即可。需要为

2021-04-16 13:39:58 261

原创 LeetCode中使用栈的题目的整理(待更)

棒球比赛(simple)https://leetcode-cn.com/circle/article/48kq9d/class Solution { public int calPoints(String[] ops) { Stack<Integer> stack = new Stack(); for(String op : ops) { if (op.equals("+")) {

2021-04-07 20:05:05 298

转载 springboot配置文件 application.yml注意事项(Failed to load property source from location ‘classpath:/applica)

转载自:springboot配置文件 application.yml注意事项(Failed to load property source from location 'classpath:/applica)

2021-03-15 00:10:41 263

原创 Spring框架笔记

SpringSpring框架概述Spring是轻量级的开源的JavaEE框架Spring可以解决企业应用开发的复杂性Spring有两个核心部分: IOC 和 AOPIOC:控制反转,把创建对象过程交给Spring进行管理AOP:面向切面,不修改源代码进行功能增强Spring特点方便解耦,简化开发AOP编程支持方便程序测试方便和其他框架进行整合方便进行事务操作降低API开发难度IOC什么是 IOC:控制反转,把对象创建和对象之间的调用过程,交给 Spring 进

2021-03-08 16:03:35 470

原创 LeetCode中关于图的题目的整理(待更)

岛屿的周长(simple难度)https://leetcode-cn.com/problems/island-perimeter/本方法思路和代码来源:作者:nettee链接:https://leetcode-cn.com/problems/island-perimeter/solution/tu-jie-jian-ji-er-qiao-miao-de-dfs-fang-fa-java-by/来源:力扣(LeetCode)// 基本的 DFS 框架:每次搜索四个相邻方格vo

2021-03-05 00:52:43 528 1

原创 LeetCode中关于字符串的题目的整理(待更)

检测大写字母(simple难度)https://leetcode-cn.com/problems/detect-capital/本题方法和代码来源:作者:linaxiaokeai163com链接:https://leetcode-cn.com/problems/detect-capital/solution/jian-ce-da-xiao-zi-fu-zai-suo-you-java-t-9ibf/来源:力扣(LeetCode)class Solution { publi

2021-02-24 11:26:47 657

原创 LeetCode中使用二分查找法的题目的整理(待更)

111

2021-02-21 19:08:58 323

转载 Java中List.contains()方法比较的是地址而不是值

本文转载自List.contains(Object object)方法使用List.contains(Object object)方法判断ArrayList是否包含一个元素对象(针对于对象的属性值相同,但对象地址不同的情况),如果没有重写List<E>的元素对象Object中的equals方法,默认如下:@Override public boolean equals(Object o) { // TODO Auto-generated method stub return s

2021-02-19 12:12:54 3016

原创 LeetCode中使用回溯算法的题目的整理(待更)

组合(medium难度)本题方法和代码来源:作者:carlsun-2链接:https://leetcode-cn.com/problems/combinations/solution/77-zu-he-hui-su-fa-jing-dian-ti-mu-by-carlsun-2/来源:力扣(LeetCode)// 存放符合条件结果的集合LinkedList<List<Integer>> result = new LinkedList<>(

2021-02-16 23:55:13 364

原创 Java中List<Integer>集合转int类型数组

Java中List<Integer>集合转int类型数组public class ListToArray { public static void main(String[] args) { // Integer集合转Integer数组,要使用toArrzy()的带参方法 //注意Integer集合不能直接转为int数组, List<Integer> list = new ArrayList<Integer>();

2021-02-15 11:57:29 2225 1

原创 LeetCode中关于二叉树的题目的整理(待更)

对称二叉树(simple难度)https://leetcode-cn.com/problems/symmetric-tree/与本题相同题目:剑指offer28.对称的二叉树本文思路及解法参考了《剑指offer28.对称的二叉树》的题解作者:jyd链接:https://leetcode-cn.com/problems/dui-cheng-de-er-cha-shu-lcof/solution/mian-shi-ti-28-dui-cheng-de-er-cha-shu-di-gui-

2021-02-08 22:07:15 547

原创 LeetCode中股票类型的题目的整理

买卖股票的最佳时机(simple难度)https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/与本题相同的题目:剑指offer63.股票的最大利润<方法一>:动态规划本方法思路及代码来源:作者:liweiwei1419链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/solution/bao-li-mei-

2021-02-07 20:43:10 289

原创 LeetCode中使用贪心算法的题目的整理(待更)

买卖股票的最佳时机Ⅱ(simple难度)https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/<方法一>:贪心算法class Solution { public int maxProfit(int[] prices) { int profit = 0; for (int i = 1; i < prices.length; i++)

2021-02-07 17:54:04 133

原创 背包问题详解与力扣上的背包问题(待更)

1 0-1背包问题1.1 问题分析1.2 算法设计1.3 完美图解1.4 伪代码详解1.5 实战演练1.6 算法解析和优化拓展注:上方图片来自陈小玉的《趣学算法》(P210-P220)重点注意:算法定义部分:算法优化部分:...

2021-02-04 14:22:39 788 1

原创 剑指offer中关于或暗含数组 / 矩阵的题目的整理(待更)

<数组中数字(字符)出现的次数>类题目:网址:待更新机器人的运动范围(medium难度)https://leetcode-cn.com/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/本题思路来源:作者:jyd链接:https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-ii-lcof/solution/mian-shi-ti-56-ii-shu-zu-zho

2021-02-04 11:13:12 86 1

原创 LeetCode热题100使用原地修改法的题目整理(待更)

找到所有数组中消失的数字(simple难度)https://leetcode-cn.com/problems/find-all-numbers-disappeared-in-an-array/class Solution { public List<Integer> findDisappearedNumbers(int[] nums) { for (int i = 0; i < nums.length; i++) { i

2021-02-04 11:12:39 89

原创 LeetCode中使用动态规划的题目的整理(待更)

LeetCode热题100中关于动态规划的题目的整理打家劫舍Ⅱ(medium难度)https://leetcode-cn.com/problems/house-robber-ii/打家劫舍(medium难度)本方法思路和代码来源:作者:jyd链接:https://leetcode-cn.com/problems/house-robber-ii/solution/213-da-jia-jie-she-iidong-tai-gui-hua-jie-gou-hua-/来源:力扣(Le

2021-02-03 18:07:13 168

原创 LeetCode热题100使用分治法的题目整理(待更)

最大子序和(simple难度)https://leetcode-cn.com/problems/maximum-subarray/与本题相同的题目:剑指offer42.连续子数组的最大和<方法一>:分治算法class Solution { public class Status { public int lSum, rSum, mSum, iSum; public Status(int lSum, int rSu

2021-02-01 13:12:17 229

原创 LeetCode热题100解法奇妙的题目整理(待更)

除自身以外数组的乘积(medium难度)https://leetcode-cn.com/problems/product-of-array-except-self/与本题相同的题目:剑指offer66.构建乘积数组<方法一>:左右乘积列表左右乘积列表实现过程:class Solution { public int[] productExceptSelf(int[] nums) { int length = n.

2021-01-31 18:59:25 545

原创 剑指offer中使用哈希表的题目的整理(待更)

最长不含重复字符的子字符串(medium难度)https://leetcode-cn.com/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/与本题相同题目:LeetCode3.无重复字符的最长子串以下方法思路及代码的来源:作者:jyd链接:https://leetcode-cn.com/problems/fei-bo-na-qi-shu-lie-lcof/solution/mian-shi-ti-10-

2021-01-31 14:39:56 100

原创 剑指offer中使用滑动窗口的题目的整理(待更)

最长不含重复字符的子字符串(medium难度)https://leetcode-cn.com/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/与本题相同题目:LeetCode3.无重复字符的最长子串本方法思路和代码来源:作者:guanpengchn链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characte

2021-01-31 14:39:38 108

原创 LeetCode热题100使用前缀和的题目整理(待更)

和为K的子数组(medium难度)https://leetcode-cn.com/problems/subarray-sum-equals-k/<方法一>:枚举public class Solution { public int subarraySum(int[] nums, int k) { int count = 0; for (int start = 0; start < nums.length; ++start) {

2021-01-31 11:25:53 321

原创 LeetCode热题100使用二分查找的题目整理(待更)

寻找重复数(medium难度)https://leetcode-cn.com/problems/find-the-duplicate-number/<方法一>:二分查找本方法代码和思路来源:作者:liweiwei1419链接:https://leetcode-cn.com/problems/find-the-duplicate-number/solution/er-fen-fa-si-lu-ji-dai-ma-python-by-liweiwei1419/来源:力扣(L

2021-01-30 19:01:41 174

原创 LeetCode热题100使用滑动窗口的题目整理(待更)

找到字符串中所有字母异位词(medium难度)https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/<方法>:滑动窗口+左右索引指针本方法代码和思路来源:作者:Jasion_han链接:https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/solution/20200321438median-by-jasion_han-r/来源

2021-01-30 13:18:15 177

原创 JavaWeb之jQuery知识点整理

jQuery介绍:什么是jQuery:jQuery是JavaScript和查询(Query),它就是辅助JavaScript开发的js类库。jQuery核心思想:它的核心思想是write less,do more(写得更少,做得更多),所以它实现了很多浏览器的兼容问题。jQuery流行程度:jQuery现在已经成为最流行的JavaScript库,在世界前10000个访问最多的网站中,有超过 55%在使用jQuery。jQuery好处:jQuery是免费、开源的,jQuery的语法设计可以使开发更

2021-01-30 10:45:46 435

原创 LeetCode热题100使用单调栈的题目整理(待更)

每日温度(medium难度)https://leetcode-cn.com/problems/daily-temperatures/class Solution { public int[] dailyTemperatures(int[] T) { int length = T.length; int[] ans = new int[length]; Deque<Integer> stack = new Linke

2021-01-29 11:37:47 161

原创 LeetCode热题100使用哈希表的题目整理(待更)

两数之和(simple难度)https://leetcode-cn.com/problems/two-sum/class Solution { public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> hashtable = new HashMap<Integer, Integer>(); for (int i = 0; i < nums.le

2021-01-28 22:46:47 245

原创 LeetCode热题100关于排序的题目整理(待更)

字母异位词分组(medium难度)https://leetcode-cn.com/problems/group-anagrams/class Solution { public List<List<String>> groupAnagrams(String[] strs) { Map<String, List<String>> map = new HashMap<String, List<String&

2021-01-28 22:46:14 214

原创 LeetCode热题100关于字符串的题目整理(待更)

字母异位词分组(medium难度)https://leetcode-cn.com/problems/group-anagrams/class Solution { public List<List<String>> groupAnagrams(String[] strs) { Map<String, List<String>> map = new HashMap<String, List<String&

2021-01-28 22:45:53 201

原创 LeetCode热题100中关于动态规划的题目的整理(待更)

爬楼梯(simple难度)https://leetcode-cn.com/problems/climbing-stairs/与本题相似题目:剑指offer10-Ⅱ.青蛙跳台阶问题class Solution { public int climbStairs(int n) { int p = 0, q = 0, r = 1; for (int i = 1; i <= n; ++i) { p = q;

2021-01-28 16:03:07 733

原创 LeetCode热题100使用双指针的题目整理(待更)

移动零(simple难度)https://leetcode-cn.com/problems/move-zeroes/<方法一>解题思路使用双指针,左指针指向当前已经处理好的序列的尾部,右指针指向待处理序列的头部。右指针不断向右移动,每次右指针指向非零数,则将左右指针对应的数交换,同时左指针右移。注意到以下性质:左指针左边均为非零数; 右指针左边直到左指针处均为零。因此每次交换,都是将左指针的零与右指针的非零数交换,且非零数的相对顺序并未改变。class

2021-01-27 18:18:22 198

原创 剑指offer中关于有限状态自动机的题目的整理(待更)

表示数值的字符串(medium难度)https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/class Solution { public boolean isNumber(String s) { Map[] states = { new HashMap<>() {{ put(' ', 0); put('s', 1)

2021-01-27 18:17:45 270

原创 LeetCode热题100使用摩尔投票法的题目整理(待更)

多数元素(simple难度)https://leetcode-cn.com/problems/majority-element/与本题相同题目:剑指offer39. 数组中出现次数超过一半的数字本文思路及解法参考了《剑指offer39.数组中出现次数超过一半的数字》的题解作者:jyd链接:https://leetcode-cn.com/problems/shu-zu-zhong-chu-xian-ci-shu-chao-guo-yi-ban-de-shu-zi-lcof/soluti

2021-01-27 18:17:23 183

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除