自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 计算机基础 -- ASCII,Unicode,UTF-8,UTF-16,UTF-32编码方式的不同

ASCII,Unicode,UTF-8,UTF-16,UTF-32编码方式的不同参考文章:Unicode Character Set and UTF-8, UTF-16, UTF-32 Encoding彻底解决乱码问题(一):为何会出现乱码Unicode字符需要几个字节来存储?ASCII(8位,但是最高位为保留位,实际使用为7位)ASCII表示了常用的符号(0 ~ 127),但是其他语...

2020-03-13 23:43:24 163

原创 LeetCode题解 -- 字符串和数组(1371)

Find the Longest Substring Containing Vowels in Even CountsGiven the string s, return the size of the longest substring containing each vowel an even number of times. That is, ‘a’, ‘e’, ‘i’, ‘o’, and...

2020-03-12 11:16:31 467 1

原创 LeetCode题解 -- 字符串和数组(560)

Subarray Sum Equals KGiven an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.方法一:Presum时间复杂度:O(n^2)空间复杂度:O(n) public int su...

2020-03-11 21:43:45 143

原创 Linux中的进程,线程的实现原理与文件描述符

Linux中的进程,线程的实现原理参考文章:Linux 进程、线程、文件描述符的底层原理 linux 输入、输出重定向的概念和用法详解程序需要先被编程成可执行文件,再将可执行文件加载进内存,OS为其分配完资源,才变为真正的进程。在Linux中,进程/线程就是一个数据结构: struct task_struct { // 进程状态 long state; // 虚拟内存结构体...

2020-03-10 18:09:08 368 1

原创 Spring源码学习(1) ---Spring解析XML过程

Spring对XML配置文件的加载过程参考:《Spring源码深度解析》环境搭建需要:spring-core,spring-beans一般最常见的使用BeanFactory获取Bean的方法如下(XmlBeanFactory现已被弃用)public void testLoad(){ BeanFactory beanFactory = new XmlBeanFactory(new Clas...

2020-03-09 20:59:07 237

原创 LeetCode题解 -- 排序(179)

Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.时间复杂度:O(n^2)空间复杂度:O(n)public String largestNumber(int[] nums) { int length = nums.l...

2020-03-07 23:23:48 102

原创 LeetCode题解 -- 排序(324)

Wiggle Sort IIGiven an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]…时间复杂度:O(n*logn)空间复杂度:O(n)将排序后的数组分为前后两部分,每次从两部分中拿出当前最大的,按顺序放入temp数组public void wiggl...

2020-03-07 21:29:52 98

原创 LeetCode题解 -- 排序(75)

Sort ColorsGiven an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will...

2020-03-07 20:20:10 105

原创 《ElasticSearch权威指南》笔记 -- 入门

入门一些基础操作:环境:ElasticSearch 6.8.2 , PostMan1.创建indices,types,documents,fieldsPUT http://127.0.0.1:9200/megacorp/employee/1{ "first_name":"John", "last_name":"Smith", "age":25, "about":"I love ...

2020-03-07 18:36:20 124

原创 计算机网络相关 -- 虚拟机中桥接模式,NAT模式,仅主机模式

虚拟机中桥接模式,NAT模式,仅主机模式区别参考:虚拟机网络配置详解(NAT、桥接、Hostonly)实例讲解虚拟机3种网络模式(桥接、nat、Host-only)wmware的vmnet0、vmnet1、vmnet8只有桥接和NAT模式可以使虚拟机访问外网。但是原理不同桥接模式使用VMnet0虚拟交换机交换数据,保证宿主主机和虚拟机同等地位。再由VMnet0与局域网路由器交换数据,从...

2020-03-07 14:11:40 200

原创 LeetCode题解 -- 双指针(524)

Longest Word in Dictionary through DeletingGiven a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If the...

2020-03-07 11:17:25 137

原创 LeetCode题解 -- 双指针(141)

Linked List CycleGiven a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked l...

2020-03-06 22:42:48 121

原创 LeetCode题解 -- 双指针(680)

Valid Palindrome IIGiven a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.时间复杂度:O(n^2)空间复杂度:O(1)没找到其他的方法,基本上都是这样做的public boolean validPalindr...

2020-03-06 22:09:16 215

原创 LeetCode题解 -- 双指针(345)

Reverse Vowels of a StringWrite a function that takes a string as input and reverse only the vowels of a string.时间复杂度:O(n)空间复杂度:O(n)代码逻辑类似于快排public String reverseVowels(String s) { int le...

2020-03-06 20:24:54 132

原创 LeetCode题解 -- 双指针(633)

Sum of Square NumbersGiven a non-negative integer c, your task is to decide whether there’re two integers a and b such that a2 + b2 = c.相似题目:LeetCode题解 – 双指针(167)时间复杂度:O(n)空间复杂度:O(1)public boolea...

2020-03-06 20:07:16 96

原创 双指针问题汇总

CSDN某篇博客汇总Cyc2018

2020-03-06 18:26:42 117

原创 LeetCode题解 -- 双指针(88)

88. Merge Sorted ArrayGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.The number of elements initialized in nums1 and nums2 are m and n respectively.You ...

2020-03-06 18:22:59 87

原创 LeetCode题解 -- 双指针(287)

Find the Duplicate NumberGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is onl...

2020-03-06 17:41:24 125

原创 LeetCode题解 -- 双指针(80)

Remove Duplicates from Sorted Array IIGiven a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for ...

2020-03-06 16:33:59 431

原创 LeetCode题解 -- 双指针(26)

Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another...

2020-03-06 14:09:27 97

原创 LeetCode题解 -- 双指针(27)

Remove ElementGiven an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying ...

2020-03-06 11:53:55 163

原创 LeetCode题解 --位运算(898)

Bitwise ORs of SubarraysWe have an array A of non-negative integers.For every (contiguous) subarray B = [A[i], A[i+1], …, A[j]] (with i <= j), we take the bitwise OR of all the elements in B, obt...

2020-03-06 10:51:51 90

原创 LeetCode题解 -- 双指针(42)

Trapping Rain WaterGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.经典的接雨水问题方法一:第 i 块区域积水面积 = M...

2020-03-05 19:29:01 79

原创 LeetCode题解 -- 双指针(11)

11. Container With Most WaterGiven n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at ...

2020-03-05 16:09:01 104

原创 LeetCode题解 -- 双指针(18)

4SumGiven an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...

2020-03-05 15:43:33 77

原创 LeetCode题解 -- 双指针(16)

3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each...

2020-03-05 14:36:01 85

原创 LeetCode题解 -- 双指针(15)

15. 3SumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.时间复杂度:O(n^2)空间复杂度:O(1)先固定第一...

2020-03-05 13:08:39 100

原创 LeetCode题解 -- 双指针(167)

167. Two Sum II - Input array is sortedGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum sh...

2020-03-05 12:27:33 101

原创 LeetCode题解 -- 双指针(325)

Maximum Size Subarray Sum Equals k 最大子数组之和为kGiven an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn’t one, return 0 instead.Given nums = [1, -1, ...

2020-03-05 10:40:18 283

原创 《剑指Offer》题解 -- 面试题06. 从尾到头打印链表

面试题06. 从尾到头打印链表输入一个链表的头节点,从尾到头反过来返回每个节点的值(用数组返回)。方法一:辅助栈时间复杂度:O(n)空间复杂度:O(n)class Solution { public int[] reversePrint(ListNode head) { Stack<Integer> stack = new Stack<>(...

2020-03-04 22:31:29 98

原创 《剑指Offer》题解 -- 面试题04. 二维数组中的查找

面试题04. 二维数组中的查找在一个 n * m 的二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。时间复杂度:O(m+n)空间复杂度:O(1)保证矩阵中每个元素只会被比较一次class Solution { public boolean findNumberIn2DA...

2020-03-04 20:28:13 120

原创 《剑指Offer》题解 -- 面试题03. 数组中重复的数字

面试题03. 数组中重复的数字在一个长度为 n 的数组 nums 里的所有数字都在 0~n-1 的范围内。数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次。请找出数组中任意一个重复的数字。解法一:利用Hash表判断时间复杂度:O(n)空间复杂度:O(n)class Solution { public int findRepeatNumber(int[]...

2020-03-04 17:34:17 147

原创 Java中List.add(list)为空问题

参考博文List调用add()方法为空解释(qq_34250494 的回答)在做LeetCode 39. Combination Sum 时使用到了递归,在合适的条件下将本次结果添加到List<List> result 中。class Solution { public List<List<Integer>> combinationSum(int...

2019-09-21 13:21:19 4993

原创 spring学习

动态代理和aop参考博客动态代理aop使用动态代理实现简单aop功能参考博客aop使用场景aop术语介绍aop概念介绍使用动态代理实现简单的aop功能动态代理个人理解为是一种用于增强现有方法的手段。aop面向切面编程,目前学到的项目里很少使用,当前理解是用来 不改变服务实现类的前提下,添加日志方法。使用动态代理实现简单aop功能例子来自于尚硅谷课程day21首先编写一个计算...

2019-09-20 21:38:22 69

空空如也

空空如也

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

TA关注的人

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