- 博客(25)
- 收藏
- 关注
转载 展望未来,总结过去10年的程序员生涯,给程序员小弟弟小妹妹们的一些总结性忠告
走过的路,回忆起来是那么曲折,把自己的一些心得体会分享给程序员兄弟姐妹们,虽然时代在变化,但是很可能你也会走我已经做过的10年的路程,有些心得体会你可以借鉴一下,觉得说得有道理的你就接纳,觉得说得没道理的,你就抛弃,以下是我发自内心的,给大家的忠告,特别是针对那些小弟弟妹妹们。01. 自己的户口档案、养老保险、医疗保险、住房公积金一定要保管好。由于程序员行业每年跳槽一次,我不隐瞒大家,
2015-06-28 14:39:23 1159 3
原创 关于tcp中time_wait状态的4个问题
面试中time_wait是个常考的问题,tcp网络编程中最不容易理解的也是它的time_wait状态,这也说明了tcp/ip四次挥手中time_wait状态的重要性。 下面通过4个问题来描述它问题1.time_wait状态是什么2.为什么会有time_wait状态3.哪一方会有time_wait状态4.如何避免time_wait状态占用资源1.time_wait状态是什么 简单来说:ti
2015-06-24 18:12:05 6360 3
原创 leetcode 35 -- Search Insert Position
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 as
2015-06-24 00:44:46 1612
原创 leetcode 34 -- Search for a Range
Search for a Range 题目: Given a sorted array of integers, 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).
2015-06-23 00:36:45 1541
原创 leetcode 33 -- Search in Rotated Sorted Array
Search in Rotated Sorted Array 题目: Suppose a sorted array 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
2015-06-22 13:04:46 2548 2
原创 leetcode 32 -- Longest Valid Parentheses
Longest Valid Parentheses 题目: Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(()”, the longest valid p
2015-06-18 13:23:58 992
原创 leetcode 31 -- Next Permutation
Next Permutation 题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearran
2015-06-15 18:52:33 1017
原创 leetcode 30 -- Substring with Concatenation of All Words
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 conc
2015-06-14 00:57:56 940
原创 leetcode 29 -- Divide Two Integers
Divide Two Integers 感想: >这道题因为有一点小问题一直导致AC不过,一会我会先贴上自己的正确代码,之前错误的贴到后面。>在一直解决不了遇到的问题时,我去网上搜了下别人做这道题的思路,感觉自己的思路也算比较简单吧,就一直坚持自己的思路,依然不知道哪里错了,调试于是查了查abs函数,发现了还有其他的类abs函数,自己没用过,labs和llabs,于是发现了自己边界的问题,改正加上了一个
2015-06-12 17:23:05 2914
原创 浅析数据库连接池(二)
上一篇博客,主要是简单的介绍了普通数据库连接的过程以及耗费的资源,并且简单的谈了下连接池,这篇我们主要来看看数据库连接池的使用以及它最优的配置。总目录: -1.数据库连接过程是怎样的? -2.连接所占用的资源有哪些? -3.连接池简介 -4.连接池的使用 -5.最优连接池配置选择今天主要看看4和5。4.连接池的使用这里我使用的是c3p0数据库连接池 简单的介绍一下c3p0:C3P0
2015-06-11 17:21:53 3878
原创 leetcode 28 -- Implement strStr()
Implement strStr() 题目: mplement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02): The signature of
2015-06-11 12:23:14 915
原创 leetcode 27 -- Remove Element
Remove Element 题目: Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn’t matter what you leave beyo
2015-06-11 12:17:56 1146
原创 浅析数据库连接池(一)
由于最近项目要用到数据库连接池,所以今天简单的聊聊~, 这个话题的引起是因为我在写mysql数据库部分时产生了一个疑问,一般后台处理数据部分,服务端是创建一个connection连接到数据库,然后所有的请求通过这一个connection来访问数据库,还是每个连接创建一个connction?这个连接需要维持多久?...接下来一起看看 首先目录1,2是为了引出下面的连接池,因为一般我们仅仅是
2015-06-11 02:37:08 11665 3
原创 leetcode 26 -- Remove Duplicates from Sorted Array
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
2015-06-10 17:32:59 1027
原创 leetcode 25 -- Reverse Nodes in k-Group
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. If the number of nodes is not a multiple of k then left-out nodes
2015-06-10 17:06:51 1183
原创 leetcode 24 -- Swap Nodes in Pairs
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 sh
2015-06-08 10:29:19 994
原创 leetcode23 -- Merge k Sorted Lists
Merge k 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. 题意: 合并k个已经排序过的链表。 思路:
2015-06-07 12:13:54 814
原创 leetcode 22 -- Generate Parentheses
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: “((()))”, “(()(
2015-06-06 23:23:08 1591
原创 leetcode 21 -- Merge Two Sorted Lists
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. 题意: 合并两个排序过的链表 思路:
2015-06-05 12:25:18 823
原创 leetcode 20 -- Valid Parentheses
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, “()”
2015-06-05 12:20:10 886
原创 leetcode 19 -- Remove Nth Node From End of List
Remove Nth Node From End of List 题目: Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After r
2015-06-05 12:14:37 996
原创 leetcode 18 -- 4Sum
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: El
2015-06-04 15:12:14 1421 2
原创 leetcode 17 -- Letter Combinations of a Phone Number
Letter Combinations of a Phone Number 题目: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho
2015-06-03 10:52:00 919
原创 leetcode 16 -- 3Sum Closest
3Sum Closest 题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each in
2015-06-02 18:48:20 899
原创 leetcode 15 -- 3Sum
3Sum 题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. For example, given array S
2015-06-01 14:06:32 870
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人