- 博客(153)
- 收藏
- 关注
原创 安装chrome插件charset步骤
下载地址(很多下载下来的不是对的):https://blog.youkuaiyun.com/qq_41756576/article/details/82496928安装伴侣:https://blog.youkuaiyun.com/qq_42690685/article/details/81039700查看版本:chrome://extensions/chrome版本号大于或等于67的用户,请参见该...
2019-11-26 12:11:48
783
转载 编译原理
1.编译器是什么?为什么会需要编译器?①编译器首先也是一种电脑程序。它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。②高级计算机语言便于人编写,阅读,维护。低阶机器语言是计算机能直接解读、运行的。编译器主要的目的是将便于人编写,阅读,维护的高级计算机语言所写作的源代码,翻译为计算机能解读、运行的低阶机器语言的程序。编译器将原始程序(Source progr...
2019-10-18 14:52:05
420
原创 面试经验参考
1.输入描述:输入为一个正整数N(1 ≤ N ≤ 1,000,000) 输出描述:输出一个最小的步数变为Fibonacci数"示例1输入15输出22.从1k的文件中,找出有多少aaa的字符串3.怎么理解递归的4.测试认识测试体系测试规划测试开发的认识怎么提现代码量怎么提现测试质量建设括号匹配5.lru 一级缓存 二级缓存6.python 常用lib库...
2019-10-17 20:09:39
210
原创 剑指offer-二进制中1的个数-java
题目描述:输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。思路解析:https://www.nowcoder.com/questionTerminal/8ee967e43c2c4ec193b040ea7fbb10b8如果一个整数不为0,那么这个整数至少有一位是1。如果我们把这个整数减1,那么原来处在整数最右边的1就会变为0,原来在1后面的所有的0都会变成1(如果最右边的...
2018-09-06 10:05:10
207
原创 剑指offer-用栈实现队列-java
题目描述:用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。思路解析:入栈:栈1是用来入栈的,栈2是辅助; 如果栈2是空的,直接入栈到栈1中,如果栈2不为空,那么就先把栈2中的push回栈1中,再入栈。 出栈:栈2是用来出栈的,栈1是辅助; 如果栈1是非空的,要把栈1的都push到栈2中,如果栈1是空的,那...
2018-09-05 14:34:08
232
转载 前序遍历-后序遍历(递归与非递归实现)——java
前序遍历:顺序为根左右转载自:https://blog.youkuaiyun.com/xuebaobao130526/article/details/80082338递归实现:当节点不为空时,每次遍历现将节点值添加进list,之后,左子树补空,遍历左子树;右指数不空,遍历右子树;最终返回list。需要注意的是根节点为空的情况,在遍历之前,根节点为空,直接返回(全局)list。public c...
2018-08-24 17:26:19
2669
2
原创 LeetCode—largest-rectangle-in-histogram(最大面积)—java
题目描述:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width ...
2018-08-09 23:32:06
412
原创 JVM垃圾回收机制总结
JVM分为三个主要的子系统(1)类加载器子系统(2)运行时数据区(3)执行引擎1.类加载器子系统Java的动态类加载功能是由类加载器子系统处理。当它在运行时(不是编译时)首次引用一个类时,它加载、链接并初始化该类文件。1.1加载类由此组件加载,遵循委托层次算法加载类文件。启动类加载器:负责从启动类路径中加载类,rt.jar,优先级比较高 扩展类加载器:负责加载ext目...
2018-07-16 18:47:03
855
原创 LeetCode—subsets(子集dfs)—java
题目描述:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,If S =[1...
2018-07-15 00:13:04
919
原创 LeetCode—sort-colors(颜色012排序)—java
题目描述:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers...
2018-07-14 00:18:26
1454
原创 LeetCode—search-a-2d-matrix(排好序的矩阵中查找)—java
题目描述:Write an efficient algorithm that searches for a value in anm x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row...
2018-07-13 23:48:44
388
原创 LeetCode—set-matrix-zeroes(矩阵置0)—java
题目描述:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A straight forward solution using O(m n) spa...
2018-07-13 23:03:54
359
原创 LeetCode—simplify-path(简化路径)—java
题目描述:Given an absolute path for a file (Unix-style), simplify it.For example,path ="/home/", =>"/home"path ="/a/./b/../../c/", =>"/c"click to show corner cases.Corner Cases:Did you consider the ...
2018-07-13 18:42:51
895
原创 LeetCode—plus-one&&sqrtx(加1&&开方)——java
题目描述:Given a number represented as an array of digits, plus one to the number.思路解析:计算加1后的数值高位在数组的开头,所以要从数组的最后开始检查每一位数字是不是小于9,如果是的话,直接加9就行了如果是小于9的就不用循环了,如果是大于9的就需要位数加1,需要加1然后判断高位是0,那么就表示进位了,就需要新建一个数组,向...
2018-07-13 00:37:54
275
原创 LeetCode—valid-number(正则表达式匹配)——java
题目描述:Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote: It is intended for the problem statement to be amb
2018-07-12 23:45:50
730
原创 LeetCode—merge-two-sorted-lists(合并链表)—java
题目描述:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路解析:合并链表一个为空,就返回另一个,否则的话进行比较,把小的拼接到新的链表后边最后看看是谁还剩下了。代...
2018-07-12 19:42:13
300
原创 LeetCode—unique-paths_iiunique-paths_minimum-path-sum_climbing-stairs_edit-distance(动态规划)——java
unique-paths题目描述:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying ...
2018-07-12 19:06:01
252
原创 LeetCode—permutation-sequence(全排列的第k个)—java
题目描述:The set[1,2,3,…,n]contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312""321&qu
2018-07-08 00:05:32
803
原创 LeetCode—spiral-matrix-ii(螺旋赋值)—java
题目描述:Given an integer n, generate a square matrix filled with elements from 1 to n 2 in spiral order.For example,Given n =3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6...
2018-07-06 00:14:22
273
原创 LeetCode—length-of-last-word(最后一个单词的长度)—java
题目描述:Given a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defin...
2018-07-05 23:52:52
1125
原创 LeetCode—insert-interval(插入间隔)—java
题目描述:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Exam...
2018-07-05 23:39:40
566
原创 LeetCode—merge-intervals(合并重叠的间隔)—java
题目描述:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].思路解析:题意:将重叠的数组合并起来我们首先要做的就是给区间集排序,由于我们要排序的是个结构体,所以我们要定义自己的c...
2018-07-05 01:17:17
1136
原创 LeetCode—spiral-matrix(螺旋矩阵)—java
题目描述:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You sho...
2018-07-05 00:28:11
856
原创 LeetCode—maximum-subarray(最大子数组的和)—java
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray[4,−1,2,1]has th...
2018-06-28 22:01:54
777
原创 LeetCode—n-queens-ii(返回解决方案的总数)—java
题目描述:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.思路解析:跟第一个题一样的解决方法,但是需要注意的是这个是计数,计数的话要用数组,因为数组就会更新里面的值。如果行数等于总行数,就可以在解决方案...
2018-06-28 19:19:04
284
原创 LeetCode—n-queens(n皇后问题)—java
题目描述:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.Each...
2018-06-28 18:05:28
1027
原创 LeetCode—powx-n(x的n次)—java
题目描述:Implement pow(x, n).思路解析:pow(x,n)分解为pow(x,n/2)*pow(x,n/2) ,但是需要区分奇数偶数。还要看n的正负号。代码:public class Solution { public double pow(double x, int n) { if(n>=0) return power(x,n...
2018-06-24 14:22:25
261
原创 LeetCode—anagrams(返回由相同字母组成的单词)—java
题目描述:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.思路解析:首先判空然后需要创建HashMap来存储排序好的字符串,以及对应有相同字母组成的ArrayList。把每个字符串Arrays.sort以后,再以HashM...
2018-06-24 14:00:51
1075
原创 LeetCode—rotate-image(顺时针旋转90度)—java
题目描述:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路解析:旋转赋值交换就可以了代码:public class Solution { public void ro...
2018-06-21 21:33:51
741
原创 LeetCode—permutations-ii(有重复数字的排列)—java
题目描述:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique permutations:[1,1,2],[1,2,1], and[2,1,1].思路解析:这个题...
2018-06-21 20:44:49
529
原创 LeetCode—permutations_combinations_permutations-sequence(全排列——DFS深度优先搜索)—java
题目描述:Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2], and[3,2,1].思路解析:https://blog.youkuaiyun.com/L...
2018-06-21 20:03:16
331
原创 LeetCode—jump-game-ii(跳跃数组的步长,返回最小步数)——java
题目描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is t...
2018-06-21 17:17:08
2514
原创 LeetCode—jump-game(跳跃步数为数组给的值)—java
题目描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if y...
2018-06-21 16:15:04
752
原创 LeetCode—wildcard-matching(正则表达式匹配)—java
题目描述:Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t...
2018-06-21 14:52:51
562
原创 LeetCode—multiply-strings(string表示的两个数字相乘)—java
题目描述:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.思路解析:大数乘法,首先大数是由字符串组成,并且高位在左,低位在右,为了乘起来方...
2018-06-21 11:25:05
2650
原创 LeetCode—trapping-rain-water(可以装多少水)—java
题目描述:Given 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.For example, Given[0,1,0,2,1,0,1,3,2,1,2,1], ...
2018-06-21 08:54:53
777
原创 LeetCode—combination-sum-ii(不能重复选取元素,来组成目标值)—java
题目描述:Given a collection of candidate numbers ( C ) and a target number ( T ), find all unique combinations in C where the candidate numbers sums to T .Each number in C may only be used once in the com...
2018-06-14 21:55:47
479
原创 LeetCode—combination-sum(从给出的数组中组成目标数字)—java
题目描述:Given a set of candidate numbers ( C ) and a target number (T ), find all unique combinations in C where the candidate numbers sums to T .The same repeated number may be chosen from C unlimited n...
2018-06-14 21:13:44
319
原创 LeetCode—count-and-say(计数并说出来)—java
题目描述:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"two 1s"or21.21is read off as"one 2, thenone 1"o...
2018-06-14 17:30:47
521
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人