随笔分类 -  C#练习用基础算法

构造用于1个方法在多线程环境下重复多次执行测试的通用方法 C#
摘要:static void MultithreadsCycleTestWithSameMethod(int threadNumber, int cycleNumber, ThreadStart action) { Console.WriteLine("Begin"); var threads = new Thread[t... 阅读全文

posted @ 2017-12-31 14:57 方辰 阅读(371) 评论(0) 推荐(0)

用于深拷贝的扩展方法 C#
摘要:using System.Runtime.Serialization.Formatters.Binary; using System.IO; public static class Tool { public static T DeepCopy(this T obj) { BinaryFormatter formatter... 阅读全文

posted @ 2017-12-28 13:43 方辰 阅读(145) 评论(0) 推荐(0)

实现泛型数组的冒泡排序算法 C#
摘要:public static class BubbleSortTool { public static void BubbleSort(this T[] array, AscendingorDescending ascendingorDescending) where T:IComparable { switch (ascending... 阅读全文

posted @ 2017-12-28 13:32 方辰 阅读(504) 评论(0) 推荐(0)

导航