摘要: 使用级数理论解释龟兔赛跑问题 首先简要介绍一下该问题的原型:首先乌龟在兔子前面一段距离,现在它们开始进行赛跑(当然兔子的速度肯定远快于乌龟)。然后下面的罗素悖论就出现了:当兔子跑到乌龟出发的位置时,这段时间乌龟已经跑了一段距离(当然这段距离有可能很短)。然后兔子又去跑刚才乌龟跑的那段距离。而这时候... 阅读全文
posted @ 2015-10-22 11:53 飘逸一刀 阅读(3032) 评论(0) 推荐(0)
摘要: 下面是快速排序具体类的实现:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ArraySort{ /// /// 快速排序。 /// public static class QuickSorter { /// /// 快速排序。 /// /// 源数组。 /// 开始索引。 /// 结束索引。 public static vo... 阅读全文
posted @ 2013-12-25 12:57 飘逸一刀 阅读(184) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ArraySort{ /// /// 堆排序。 /// public static class HeapSorter { /// /// 建立最大堆。 /// /// 源数组。 public static void BuildHeap(ref int[] ary) { f... 阅读全文
posted @ 2013-12-25 11:12 飘逸一刀 阅读(190) 评论(0) 推荐(0)
摘要: /// /// 归并排序。 /// public static class MergedSorter { public static IEnumerable Sort(IEnumerable ary) { if (ary.Count() == 1) return ary; IEnumerable lhalf = Sort(ary.Take(ary.Count() / 2)); IEnumerable rhalf = Sort(ary.Ski... 阅读全文
posted @ 2013-12-24 16:44 飘逸一刀 阅读(180) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ArraySort{ /// /// 冒泡排序。 /// public static class BubbledSorter { /// /// 排序。 /// /// 源数组。 /// 是否按降序排列。 /// 目标数组。 public static int[] Sort(in... 阅读全文
posted @ 2013-12-24 16:41 飘逸一刀 阅读(143) 评论(0) 推荐(0)
摘要: 今天看到一个面试题很有意思:namespace EventTest{ class Program { static void Main(string[] args) { A a = new C(); a.Show(); Console.ReadKey(); } } public class A { public virtual void Show() { Console.WriteLine("A"); ... 阅读全文
posted @ 2013-12-17 15:16 飘逸一刀 阅读(170) 评论(0) 推荐(0)
摘要: #include #include #include #include #include #pragma comment(lib, "advapi32.lib")TCHAR szCommand[10];TCHAR szSvcName[80];SC_HANDLE schSCManager;SC_HANDLE schService;VOID __stdcall DisplayUsage(void);VOID __stdcall DoStartSvc(void);VOID __stdcall DoUpdateSvcDacl(void);VOID __stdcall DoStopS 阅读全文
posted @ 2013-12-12 17:35 飘逸一刀 阅读(1697) 评论(0) 推荐(0)