摘要:
可以用c的方法 1 class Solution { 2 public: 3 char *strStr(char *haystack, char *needle) { 4 // IMPORTANT: Please reset any member data you decla... 阅读全文
posted @ 2013-03-21 15:32
ying_vincent
阅读(140)
评论(0)
推荐(0)
摘要:
这种强烈找规律的题目基本面试面到就挂,看了网上答案 1 class Solution { 2 public: 3 vector grayCode(int n) { 4 // Start typing your C/C++ solution below 5 //... 阅读全文
posted @ 2013-03-21 14:54
ying_vincent
阅读(145)
评论(0)
推荐(0)
摘要:
第一次memory exceed了,想复杂了,看了答案才知道只要函数系数多点就行了。。 1 class Solution { 2 public: 3 void dfs(int dep, int leftnum, int n, vector &ret, int leftnumtotal, st... 阅读全文
posted @ 2013-03-21 14:31
ying_vincent
阅读(129)
评论(0)
推荐(0)
摘要:
忘记加tmp->left = NULL了,少数次改 贴上另外一段 C# 1 /** 2 * Definition for a binary tree node. 3 * public class TreeNode { 4 * public int val; 5 * public TreeNode l 阅读全文
posted @ 2013-03-21 12:21
ying_vincent
阅读(146)
评论(0)
推荐(0)
摘要:
一开始有失误,发现如果外面定义了int ret, for循环里第一个条件为int ret = 1的话,这里的ret跟外面的ret不一样。少数次过 1 class Solution { 2 public: 3 int firstMissingPositive(int A[], int n) {... 阅读全文
posted @ 2013-03-21 11:02
ying_vincent
阅读(152)
评论(0)
推荐(0)
摘要:
知道是dp,没弄出状态方程。。 1 class Solution { 2 public: 3 int minDistance(string word1, string word2) { 4 // Start typing your C/C++ solution below 5... 阅读全文
posted @ 2013-03-21 10:44
ying_vincent
阅读(132)
评论(0)
推荐(0)
浙公网安备 33010602011771号