上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: 问题描述: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca", When s3 = "aadbbcbcac 阅读全文
posted @ 2016-09-02 20:23 32ddd 阅读(327) 评论(0) 推荐(0) 编辑
摘要: Unique Binary Search Trees:求生成二叉排序树的个数。 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n 阅读全文
posted @ 2016-08-31 19:26 32ddd 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135", retu 阅读全文
posted @ 2016-08-31 16:30 32ddd 阅读(1416) 评论(1) 推荐(0) 编辑
摘要: ReverseLinkedList: ReverseLinkedList2: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NU 阅读全文
posted @ 2016-08-30 23:39 32ddd 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 问题描述: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, deter 阅读全文
posted @ 2016-08-30 16:19 32ddd 阅读(690) 评论(0) 推荐(0) 编辑
摘要: 问题描述: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the tot 阅读全文
posted @ 2016-08-26 16:49 32ddd 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible repres 阅读全文
posted @ 2016-08-26 15:55 32ddd 阅读(369) 评论(0) 推荐(0) 编辑
摘要: /* w代表物品重量,v代表物品价值,c代表背包最大能容纳重量 res[i][j]代表背包可以选择前i个物品,最大容量为j时候的最大价值 res[i-1][j] if(w[i-1] > j) res[i][j] = max((res[i-1][j-w[i-1]]+v[i-1]), res[i-1][j]) else **/ public c... 阅读全文
posted @ 2016-08-25 21:16 32ddd 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserv 阅读全文
posted @ 2016-08-24 20:11 32ddd 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the fol 阅读全文
posted @ 2016-08-24 17:12 32ddd 阅读(353) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页