- 博客(54)
- 问答 (2)
- 收藏
- 关注
原创 tomcat线程配置(需继续验证)
准备各参数具体含义可以参考参数说明服务端对请求进行拦截,长时间不返回结果测试1.测试一服务端配置:server.tomcat.max-threads=1server.tomcat.min-spare-threads=1server.tomcat.accept-count=1server.tomcat.max-connections=1客户端测试时,同时发起5个http请求,结...
2020-02-13 09:57:02
513
原创 IDEA运行Tomcat8源码-8.5.41
IDEA运行Tomcat8源码-8.5.41源码下载修改源码目录配置idea参考源码下载官网下载,选择Source Code Distributions里的zip包,下载之后解压到自己的指定目录中。下载地址:https://tomcat.apache.org/download-80.cgi修改源码目录在解压后的apache-tomcat-8.5.41-src目录中新建catalina-...
2019-05-19 16:25:56
818
原创 006重建二叉树
第六题要求根据所给的前序和中序遍历结果重新构建二叉树,答案里给的虽然也是递归方式,但是我没有看懂,于是自己写了一个,试了几个案例通过了,目前没发现问题。但是这里需要有一个全局变量index,用来确定当前处理的是前序数组中的哪个数,由于java不能使用指针,因此只能通过下标来确定起始位置。代码中的n1是前序数组,n2是中序数组,left是需要搜索的中序数组的起始位置,right是需要搜索的中序数组的
2018-01-27 17:35:11
191
原创 0152_Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest pr
2018-01-16 20:46:14
241
原创 Java-spring构造顺序
Java参考http://blog.youkuaiyun.com/u011080472/article/details/51330114,可以看到java的初始化顺序为:(同一级别应该按照声明顺序构造,尚未验证) 1.父类静态代码区和父类静态成员 2.子类静态代码区和子类静态成员 3.父类非静态代码区和普通成员 4.父类构造函数 5.子类非静态代码区和普通成员 6.子类构造函数sp
2018-01-15 20:49:38
337
原创 0042_Trapping Rain Water
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],
2017-08-15 22:10:01
198
原创 0041_First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant spa
2017-08-15 21:45:57
169
原创 0040_Combination Sum II
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 combination
2017-08-15 21:16:12
211
原创 0039_Combination Sum
Given a set of candidate numbers (C) (without duplicates) 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
2017-07-31 22:38:43
350
原创 0038_Count and Say
The count-and-say sequence is the sequence of integers with the first five terms as following:111211211111221 1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off
2017-07-30 23:13:22
194
原创 0037_Sudoku Solver
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character ‘.’.You may assume that there will be only one unique solution. A sudoku puzzle…
2017-07-30 16:19:53
193
原创 0036_Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’. A partially filled sudok
2017-07-26 22:20:27
173
原创 0035_Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.
2017-07-25 21:57:21
170
原创 0034_Search for a Range
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the targ
2017-07-25 21:38:52
201
原创 0033_Search in Rotated Sorted Array
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in t
2017-07-25 20:41:11
171
原创 0031_Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o
2017-07-10 23:44:39
193
原创 0030_Substring with Concatenation of All Words_未完成
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and wi
2017-07-05 23:11:15
337
原创 0029_Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.JAVA方法一控制好符号及边界条件,直接考虑循环使用被除数减去除数,统计循环次数即为结果,果然超时。方法二由于不能直接进行乘除和取余操作,所以直
2017-07-05 22:05:17
248
原创 0027_Remove Element
Given an array and a value, 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 in place with constant memory.The
2017-06-28 22:29:59
183
原创 0026_Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with c
2017-06-28 21:46:09
202
原创 0025_Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number of
2017-06-28 21:39:37
205
原创 0024_Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You m
2017-06-27 21:54:29
171
原创 0023_Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.JAVA方法一可以把输入看做一个二维数组,数组的每一行都是递增的,因此每次只找第一列中最小的元素放入结果链表的尾部,然后将该行后续的数字前移。结果超时/** * Defini
2017-06-26 22:31:41
301
原创 0022_Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())
2017-06-21 22:44:22
158
原创 0021_Merge Two Sorted Lists
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.JAVA直接将两个链表拼接成一个,时间复杂度O(N)O(N)但是效率排名在后1/4,而效率最高的方法竟然是
2017-06-21 19:54:05
138
原创 0020_Valid Parentheses
Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all valid bu
2017-06-14 22:38:48
275
原创 0019_Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list
2017-06-14 21:04:07
155
原创 0018_4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution set
2017-06-12 20:19:40
208
原创 0017_Letter Combinations of a Phone Number
JAVA方法一要求数字对应的全部字母的组合,直接递归就可以了,不过效率不够高,大概排在中间的位置,要考虑优化。而且在写代码的时候,对substring,list的应用不熟,记不清关键字的拼写。。尴尬。。public class Solution { public List letterCombinations(String digits) { List
2017-06-08 22:35:32
219
原创 0016_3Sum Closest
JAVA在看过0015_3Sum的解题思路之后,本题作为练习,采用同样的思路进行运算。即使在看过3Sum之后,写代码时仍然有多处边界判断不准确,导致溢出或死循环。。。不过这种方法的效率还可以,大概排在前1/3左右。public class Solution { public int threeSumClosest(int[] nums, int target) {
2017-06-07 21:46:36
182
原创 0014_Longest Common Prefix
求一个字符串数组中的最长前缀。JAVA方法一直接暴力解决,最差时间复杂度O(N2)O(N^2) 没想到竟然AC了。。而且效率排名还在一般左右。。。public class Solution { public String longestCommonPrefix(String[] strs) { if(strs.length == 0){
2017-06-04 22:12:50
158
原创 0013_Roman to Integer
Java设置一个hashmap,字符为键值,数字为值,从左向右读取字符串中的字符,若后一位的取值比前一位的大,说明需要做减法,否则做加法。O(N)的时间复杂度,但是排名在后1/4。。。public class Solution { public int romanToInt(String s) { HashMap map = new HashMap();
2017-06-04 21:19:48
219
空空如也
使用winpcap发包之后,在接收端检测不到
2014-08-28
QT ARM 交叉编译 求帮助
2014-03-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人