﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Lance.Liang-最新评论</title><link>http://www.cnblogs.com/nuaalfm/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Sun, 24 Aug 2008 16:19:36 GMT</pubDate><lastBuildDate>Sun, 24 Aug 2008 16:19:36 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1274868.html#1296731</link><dc:creator>雅阁布</dc:creator><author>雅阁布</author><pubDate>Mon, 25 Aug 2008 03:04:47 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1274868.html#1296731</guid><description><![CDATA[不错！！<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">雅阁布</a> 2008-08-25 11:04 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1274868.html#1296731#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 今夜，奥运谢幕，但并不完美</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1275366.html#1296512</link><dc:creator>丁学</dc:creator><author>丁学</author><pubDate>Mon, 25 Aug 2008 00:44:24 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1275366.html#1296512</guid><description><![CDATA[那个文艺表演，搞得我想睡觉，太没意思了，有一些场景像极了春晚<br/>焰火确实很好看<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">丁学</a> 2008-08-25 08:44 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/25/1275366.html#1296512#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296101</link><dc:creator>Cat Chen</dc:creator><author>Cat Chen</author><pubDate>Sun, 24 Aug 2008 04:31:38 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296101</guid><description><![CDATA[@Lance.Liang<br/>用泛型确实比较好，只要你多用一点，你就习惯泛型的思维了。我觉得最简单的做法就是多用Linq，你很快就会对泛型和lamda运用自如。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">Cat Chen</a> 2008-08-24 12:31 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296101#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296098</link><dc:creator>Cat Chen</dc:creator><author>Cat Chen</author><pubDate>Sun, 24 Aug 2008 04:25:03 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296098</guid><description><![CDATA[你的comparator（也就是Compare()）设计其实是不对的，返回bool只能表示两种情况，但实际上偏序关系也必须至少要有3种情况来表示（在数值大小的全序关系中这叫做“大于”、“等于”、“小于”）。<br/><br/>你可以看看楼上提到的IComparable，它的comparator（也就是CompareTo()）才是正确的，通过返回一个int来区分这三种状态。当然，继承自IComparable比较麻烦，所以还是写lamda最快，但lamda应该返回int。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">Cat Chen</a> 2008-08-24 12:25 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296098#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296085</link><dc:creator>Lance.Liang</dc:creator><author>Lance.Liang</author><pubDate>Sun, 24 Aug 2008 03:52:08 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296085</guid><description><![CDATA[@Steven Chen<br><br/>呵，可能这个例子举的不够恰当，如果举个框架中不支持的更实用的例子就好了<br><br/>@guojing<br><br/>不同类型的排序的前提也是要提供比较算法，我觉得使用委托是可以解决的<br><br/>@Angel Lucifer<br><br/>恩，不错，用范型是更好些<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">Lance.Liang</a> 2008-08-24 11:52 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296085#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296049</link><dc:creator>水言木</dc:creator><author>水言木</author><pubDate>Sun, 24 Aug 2008 02:58:17 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296049</guid><description><![CDATA[ 学习..<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">水言木</a> 2008-08-24 10:58 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296049#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296009</link><dc:creator>jannock</dc:creator><author>jannock</author><pubDate>Sun, 24 Aug 2008 01:29:50 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296009</guid><description><![CDATA[学习。。<iframe src="http://www.cnblogs.com/jannock" height="0" width="0"></iframe><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">jannock</a> 2008-08-24 09:29 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1296009#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295886</link><dc:creator>Angel Lucifer</dc:creator><author>Angel Lucifer</author><pubDate>Sat, 23 Aug 2008 16:48:49 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295886</guid><description><![CDATA[同意楼主的观点。<br>不过另举一例，嘿嘿。<br>在接口实现时，可以这样实现：<br><br>static void BubbleSort&lt;T&gt;(T[] array) where T : IComparable&lt;T&gt;<br>{<br>    for (int i = 0; i < array.Length - 1; i++)<br>    {<br>        for (int j = array.Length - 1; j > i; j--)<br>        {<br>            if (array[j].CompareTo(array[j - 1]) < 0)<br>            {<br>                T temp = array[j];<br>                array[j] = array[j - 1];<br>                array[j - 1] = temp;<br>            }<br>        }<br>    }<br>}<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">Angel Lucifer</a> 2008-08-24 00:48 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295886#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295881</link><dc:creator>guojing</dc:creator><author>guojing</author><pubDate>Sat, 23 Aug 2008 16:40:01 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295881</guid><description><![CDATA[能不能不同类型彼此排序呢?<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">guojing</a> 2008-08-24 00:40 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295881#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 一道笔试题的解法和联想</title><link>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295880</link><dc:creator>Angel Lucifer</dc:creator><author>Angel Lucifer</author><pubDate>Sat, 23 Aug 2008 16:38:01 GMT</pubDate><guid>http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295880</guid><description><![CDATA[C++ 中使用仿函数进行排序的点子也不错，而且因为内联，比委托的性能高不少。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/nuaalfm/" target="_blank">Angel Lucifer</a> 2008-08-24 00:38 <a href="http://www.cnblogs.com/nuaalfm/archive/2008/08/24/1274868.html#1295880#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>