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-02-04 13:06:08
阅读次数:
136
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input:Digit st...
分类:
其他好文 时间:
2015-02-04 09:32:52
阅读次数:
189
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 va...
分类:
其他好文 时间:
2015-02-04 09:27:00
阅读次数:
108
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.
Note:
Elements in a triplet (a,b,c...
分类:
其他好文 时间:
2015-02-03 09:35:05
阅读次数:
134
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 input would have
exact...
分类:
其他好文 时间:
2015-02-03 09:33:14
阅读次数:
96
昨天看了meituan.com的AC算法在美团上单系统的应用一文,深受启发,原来ACM算法在工程中也能有这样赤裸裸的运用~~~ 于是便复习了AC自动机,并把代码用java重新搞了一遍~~
AC自动机整体的结果大概是长这样的,其实就是在trie树上做KMP :
AC自动机里面比较难理解的应该是它的失配指针的计算过程。
这个计算过程从本质上讲就是进...
分类:
其他好文 时间:
2015-02-01 16:08:56
阅读次数:
315
链接地址:http://acm.hdu.edu.cn/showproblem.php?pid=5167
Fibonacci
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 474 Accepted Submis...
分类:
其他好文 时间:
2015-02-01 09:38:10
阅读次数:
165