我觉着写得比看到的答案更清晰~
class Solution {
public:
TreeNode *ltob(ListNode *head, ListNode *end) {
if(head == end) {
TreeNode * node = new TreeNode(head->val);
return node;...
分类:
其他好文 时间:
2014-09-09 12:56:58
阅读次数:
166
---恢复内容开始--- 1 class Solution { 2 public: 3 bool wordBreak(string s, unordered_set &dict) { 4 int nsize=s.size(); 5 int i=0,j=0; 6...
分类:
其他好文 时间:
2014-09-09 11:37:18
阅读次数:
242
---恢复内容开始--- 1 class Solution { 2 public: 3 int largestRectangleArea(vector &height) { 4 int n = height.size(); 5 if(n == 0) 6 ...
分类:
其他好文 时间:
2014-09-09 11:27:28
阅读次数:
217
Issue:Reporting Services ErrorThe permissions granted to user 'IDEAAM\William' are insufficient for performing this operation. (rsAccessDenied) Get On...
分类:
数据库 时间:
2014-09-09 11:22:48
阅读次数:
264
public class Solution { public ListNode detectCycle(ListNode head) { ListNode slow = head; ListNode fast = head; boolean hasCy...
分类:
其他好文 时间:
2014-09-09 11:13:48
阅读次数:
204
1 public class Solution { 2 public void setZeroes(int[][] matrix) { 3 int m=matrix.length; 4 int n=matrix[0].length; 5 bo...
分类:
其他好文 时间:
2014-09-09 10:38:48
阅读次数:
203
1 public class Solution { 2 public int[][] generateMatrix(int n) { 3 int num=1; 4 int [][] result = new int[n][n]; 5 6 ...
分类:
其他好文 时间:
2014-09-09 10:27:58
阅读次数:
206
觉着自己写的比看到的答案精简,分享一下:
class Solution {
public:
ListNode *deleteDuplicates(ListNode *head) {
if(head == NULL) return NULL;
ListNode res(-1);
ListNode* pre = &res;
pr...
分类:
其他好文 时间:
2014-09-08 01:03:16
阅读次数:
267
1 public class Solution { 2 public int maxProfit(int[] prices) { 3 if (prices.length prices[i]) buyPrices = prices[i];11 }12 ...
分类:
其他好文 时间:
2014-09-08 01:00:16
阅读次数:
200
public class Solution { public boolean searchMatrix(int[][] matrix, int target) { int low=0, high=matrix.length-1; while (low target)...
分类:
其他好文 时间:
2014-09-08 00:58:06
阅读次数:
347