1.写法有2种:yield return 和yield breakyield用于在迭代中返回一个值,并将值带入下一次迭代中。yield break则意味着停止迭代。纯粹的文字描述,一千个人有一千个说法,还是用代码更容易说清楚。2.官方示例(略带修改): private void button1_Cl...
分类:
其他好文 时间:
2014-06-27 19:19:31
阅读次数:
219
这题竟然出错在了快排上,对double类型的数据排序,return a>b?1:-1;如果还是减的话则会造成数据丢失http://acm.hdu.edu.cn/showproblem.php?pid=1875#include #include #include #include #include u...
分类:
其他好文 时间:
2014-06-27 00:53:08
阅读次数:
422
题目:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]...
分类:
其他好文 时间:
2014-06-26 15:59:16
阅读次数:
207
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-06-26 15:55:21
阅读次数:
200
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.时间复杂度O(n^3),最大全1子矩阵,利用直方图求解,可以参考对...
分类:
其他好文 时间:
2014-06-26 15:08:46
阅读次数:
164
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"],
["a","a","b"]
]
【题意】
给定一个字符串s, 要求对s进行...
分类:
其他好文 时间:
2014-06-26 13:21:59
阅读次数:
182
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Analysis: 这个题简单的版本是判断两个单词是不是anagram,一...
分类:
其他好文 时间:
2014-06-26 12:47:48
阅读次数:
144
/**
* Created by W.J.Chang on 2014/6/25.
*/
;(function($) {
var methods= {
check: function() {
return this.each(function() { this.checked = true; });
}
};
$...
分类:
Web程序 时间:
2014-06-26 11:33:43
阅读次数:
368
最近写程序的时候发现一个这样的问题,一个if判断如下:[php]if (!empty(trim($ch_url))) { ...}[/php]执行程序报出如下错误:[code]Fatal error: Can't use function return value in write context ...
分类:
其他好文 时间:
2014-06-26 11:15:31
阅读次数:
195
Spring注解学习手札(一)构建简略Web使用Spring注解学习手札(二)操控层整理Spring注解学习手札(三)表单页面处置Spring注解学习手札(四)持久层分析Spring注解学习手札(五)事务层事务处置Spring注解学习手札(六)测验Spring注解学习手札(七)补遗——@ResponseBody,@..
分类:
编程语言 时间:
2014-06-26 06:36:02
阅读次数:
219