随笔分类 -  C# 數據結構與算法

C#算法(三)
摘要:希尔排序(Shell Sort)是插入排序的一种。因D.L.Shell于1959年提出而得名。  希尔排序基本思想  基本思想:  先取一个小于n的整数d1作为第一个增量,把文件的全部记录分成d1个组。所有距离为dl的倍数的记录放在同一个组中。先在各组内进行直接插入排序;然后,取第二个增量d2<d1重复上述的分组和排序,直至所取的增量dt=1(dt<dt-l<…<... 阅读全文

posted @ 2009-12-10 09:02 Mayvar 阅读(533) 评论(0) 推荐(1)

C#與二叉樹
摘要:首先,我們定義一個節點類:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1publicclassNode2{3publicintData;4publicNodeLeft;5publicNodeRight;6publicvoidDisplayNod... 阅读全文

posted @ 2009-12-09 09:14 Mayvar 阅读(363) 评论(0) 推荐(0)

C#算法(二)
摘要:基本的二叉查找第一種採用遞歸的方式;第二種是迭代方式;直接看代碼:(VS2008中通過)代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1publicintRbinSearch(intvalue,intlow,intupper,int[]a)2{3... 阅读全文

posted @ 2009-12-08 11:18 Mayvar 阅读(210) 评论(0) 推荐(0)

C#算法(一)
摘要:一、冒泡排序(Bubble) 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1publicclassBubbleSorter2{3publicvoidSort(int[]list)4{5inti,j,temp;6booldone=false;7j... 阅读全文

posted @ 2009-12-07 19:34 Mayvar 阅读(262) 评论(0) 推荐(0)

导航