随笔分类 -  Algorithm

摘要:C# code snippet below is an illustration of the Cooky-Turkey algorithm, the performance may suck when processing huge datasets, but you can use arrays of double instead of arrays of complex number structure to reduce the performance impact by object initializations and method invocations(overloaded operators). 阅读全文

posted @ 2007-08-10 15:30 Adrian H. 阅读(3234) 评论(3) 推荐(0)

摘要:The source code demonstrates a basic principle of these two compression algorithms[Download]Note: The LZW compression class is implemented as a fixed length code which you can specify, the huffman alg... 阅读全文

posted @ 2007-06-27 22:00 Adrian H. 阅读(5817) 评论(2) 推荐(0)

摘要:强名签名了的程序集都有一个Public Key Token, 每个引用了它的程序集的metadata中都会记录下这个Public Key Token.用ILdasm反编译一个强名签名的程序集得到的IL文件里可以看到一个160字节长的Public Key, 它跟Public Key Token有什么关系呢? 其实很简单... 以下的一小段程序便可以计算和输出Public Key Token: Cod... 阅读全文

posted @ 2007-06-21 21:19 Adrian H. 阅读(1020) 评论(0) 推荐(0)

摘要:GLEE 是 Microsoft Research 的 Lev Nachmanson 开发的一个.NET 图形布局和查看的工具, 遵循了 Sugiyama 方案, 可以生成有层次的的布局, 自然地使用图形表示流程的信息, 如程序流程, 状态机, 类图等等.. 阅读全文

posted @ 2007-06-12 19:50 Adrian H. 阅读(1550) 评论(2) 推荐(0)

摘要:一个LL(1)文法推导的课程设计 阅读全文

posted @ 2007-06-01 22:19 Adrian H. 阅读(1179) 评论(1) 推荐(0)

摘要:操作系统概念中"哲学家就餐问题"的C#模拟 阅读全文

posted @ 2007-04-01 19:04 Adrian H. 阅读(1840) 评论(0) 推荐(0)

摘要:Inspired by http://incubator.quasimondo.com/processing/fastblur.pde , I wrote a piece of CSharp code to implement this efficient "gaussian blur" alogorithm for one of my .Net project. The concept of the "fast" is avoiding floating point calculation and pre-calculating some multiplication operation, storing the results into a large two-dimension array for later blurring operations, so it saves lots of time. 阅读全文

posted @ 2007-03-30 22:17 Adrian H. 阅读(27661) 评论(6) 推荐(0)

摘要:用了一点简单的回溯就可以建立一个数独Grid了, 算法并不复杂, 效率也很不错哦. 求解一个数独其实也可以用回溯搞定. Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->using System; using System.Collectio... 阅读全文

posted @ 2007-03-08 22:14 Adrian H. 阅读(4519) 评论(8) 推荐(0)

摘要:.......... 阅读全文

posted @ 2007-03-06 22:42 Adrian H. 阅读(13785) 评论(11) 推荐(2)

摘要:C#实现的泛型遗传算法 阅读全文

posted @ 2007-02-11 16:24 Adrian H. 阅读(767) 评论(0) 推荐(0)

摘要:在CSDN上看到这个问题, 觉得有点意思就用C#写了这么个算法...其实不是很复杂, 主要是要处理多种输入的情况.输出的例子:12341234一千二百三十四万一千二百三十四10001024一千万一千零二十四199998001一亿九千九百九十九万八千零一其实有的地方念"两"比"二"要舒服, 这个问题...这个算法就没考虑了..算法代码如下:using System;using System.Coll... 阅读全文

posted @ 2007-01-07 17:52 Adrian H. 阅读(544) 评论(1) 推荐(0)

摘要:I wrote two generic class to implement these two algorithms, so you can use these classes to generate permutations and combinations for some use, such as software testing.Using the Code: using System... 阅读全文

posted @ 2006-11-25 16:21 Adrian H. 阅读(7378) 评论(12) 推荐(1)

摘要:Question有一根27厘米的细木杆,在第3厘米、7厘米、11厘米、17厘米、23厘米这五个位置上各有一只蚂蚁。木杆很细,不能同时通过一只蚂蚁。开始时,蚂蚁的头朝左还是朝右是任意的,它们只会朝前走或调头,但不会后退。当任意两只蚂蚁碰头时,两只蚂蚁会同时调头朝反方向走。假设蚂蚁们每秒钟可以走一厘米的距离。编写程序,求所有蚂蚁都离开木杆的最小时间和最大时间。最小时间肯定大家都很容易就想到了, 就是蚂... 阅读全文

posted @ 2006-11-20 15:18 Adrian H. 阅读(1678) 评论(0) 推荐(0)

摘要:From Rotor(Shared Source CLI) :/*77: Implementation Notes:78: Dictionary was copied from Hashtable's source - any bug fixes here79: probably need to be made to Dictionary as we... 阅读全文

posted @ 2006-11-12 17:25 Adrian H. 阅读(904) 评论(0) 推荐(0)

摘要:用C#写的一个算法, 功能是从一个数组中选择第 i 小的一个数, 平均时间复杂度是Θ(n). 阅读全文

posted @ 2006-11-06 19:29 Adrian H. 阅读(406) 评论(0) 推荐(0)