1 public class Solution { 2 public ListNode
mergeTwoLists(ListNode l1, ListNode l2) { 3 ListNode safe = new ListNode(-1); 4
ListNode pre = safe; 5 whi...
分类:
其他 时间:
2014-02-06 16:45:18
收藏:
0 评论:
0 赞:
0 阅读:
410
Given a strings1, we may represent it as a
binary tree by partitioning it to two non-empty substrings recursively.Below is
one possible representation...
分类:
其他 时间:
2014-02-06 16:43:38
收藏:
0 评论:
0 赞:
0 阅读:
437
最近在学习字符串的知识,在字符串上我跟大一的时候是没什么区别的,所以恶补了很多基础的算法,今天补了一下字符串哈希,看的是大一新生的课件学的,以前觉得字符串哈希无非就是跟普通的哈希没什么区别,倒也没觉得有什么特别大的用处,敲一敲才发现其实讲究还是比较多的。哈希冲突是常有的事,换一下mod,换一下进制数...
分类:
其他 时间:
2014-02-06 16:42:48
收藏:
0 评论:
0 赞:
0 阅读:
398
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,...
分类:
其他 时间:
2014-02-06 16:41:58
收藏:
0 评论:
0 赞:
0 阅读:
354
Now, instead outputting board configurations,
return the total number of distinct solutions. 1 public class Solution { 2
public int totalNQueens(int n...
分类:
其他 时间:
2014-02-06 16:41:08
收藏:
0 评论:
0 赞:
0 阅读:
481
今天注册了博客园!O(∩_∩)O~在这里将开始我的另一段编程路上的旅程!新的一年,新的自我,新的开始!~~我爱编程!oh~oh~~
分类:
其他 时间:
2014-02-06 16:40:18
收藏:
0 评论:
0 赞:
0 阅读:
258
Given two numbers represented as strings,
return multiplication of the numbers as a string. 1 public class Solution { 2
public String multiply(String ...
分类:
其他 时间:
2014-02-06 16:39:28
收藏:
0 评论:
0 赞:
0 阅读:
514
It is well known that AekdyCoin is good at
string problems as well as number theory problems. When given a string s, we can
write down all the non-emp...
分类:
其他 时间:
2014-02-06 16:38:38
收藏:
0 评论:
0 赞:
0 阅读:
479
Follow up for "Search in Rotated Sorted
Array":What ifduplicatesare allowed?Would this affect the run-time complexity?
How and why?Write a function to...
分类:
其他 时间:
2014-02-06 16:37:48
收藏:
0 评论:
0 赞:
0 阅读:
390
1 public class Solution { 2 public ListNode
deleteDuplicates(ListNode head) { 3 if(head==null || head.next==null) 4 return
head; 5 ListNode safe = new...
分类:
其他 时间:
2014-02-06 16:36:58
收藏:
0 评论:
0 赞:
0 阅读:
441
1 public class Solution {2 public int
maxDepth(TreeNode root) {3 if(root==null)4 return 0;5 return
Math.max(maxDepth(root.left),maxDepth(root.right))+...
分类:
其他 时间:
2014-02-06 16:36:08
收藏:
0 评论:
0 赞:
0 阅读:
312
Given a singly linked list where elements are
sorted in ascending order, convert it to a height balanced BST. 1 // We shuould
use a static variable in...
分类:
其他 时间:
2014-02-06 16:35:18
收藏:
0 评论:
0 赞:
0 阅读:
331
Given a binary tree, check whether it is a
mirror of itself (ie, symmetric around its center).For example, this binary tree
is symmetric: 1 / \ 2 2 / ...
分类:
其他 时间:
2014-02-06 16:34:28
收藏:
0 评论:
0 赞:
0 阅读:
393
Implement next permutation, which rearranges
numbers into the lexicographically next greater permutation of numbers.If such
arrangement is not possibl...
分类:
其他 时间:
2014-02-06 16:33:38
收藏:
0 评论:
0 赞:
0 阅读:
336
1、物料期间关闭只影响到物料的出入库,如果关闭某月份,该月份不能再进行出入库处理,对应的凭证也就不能再进入FI。因为月结前步骤很多,所以这是月结检查的其中一个步骤。以下转载自SAP
方丈的博客http://blog.vsharing.com/SAP100/A723983.htmlSAP月结操作讲解步...
分类:
其他 时间:
2014-02-06 16:31:58
收藏:
0 评论:
0 赞:
0 阅读:
2192
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]. 1 public
clas...
分类:
其他 时间:
2014-02-06 16:32:48
收藏:
0 评论:
0 赞:
0 阅读:
418
Given a collection of candidate numbers (C) and
a target number (T), find all unique combinations inCwhere the candidate numbers
sums toT.Each number ...
分类:
其他 时间:
2014-02-06 16:31:08
收藏:
0 评论:
0 赞:
0 阅读:
410
题意:在一张图中会有重边,然后每条边上有两个权值,一个温度一个距离,让你找一条温度的最小瓶颈路,让这条最小瓶颈路距离最短。思路:二分温度,然后用Dijkstra判断,最后输出答案。虽然想到思路后很简单,但是我一开始没注意看会有重边所以错了好多次。代码如下:
1 /******************...
分类:
其他 时间:
2014-02-06 16:30:18
收藏:
0 评论:
0 赞:
0 阅读:
565
Given two integersnandk, return all possible
combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution
is:[ [2,4], [3,4], [2,3], [1...
分类:
其他 时间:
2014-02-06 16:29:28
收藏:
0 评论:
0 赞:
0 阅读:
447
Given a set of candidate numbers (C) and a
target number (T), find all unique combinations inCwhere the candidate numbers
sums toT.Thesamerepeated num...
分类:
其他 时间:
2014-02-06 16:28:38
收藏:
0 评论:
0 赞:
0 阅读:
414