
数据结构
文章平均质量分 77
acefly
左手程序右手诗 ~_~
展开
-
链表中链入对象
似乎你也注重到了,不管怎么定义,似乎一个链表中的对象都是同一类型的。而实际上,这也是必须的,否则,返回节点中的数据这样的函数的返回值的类型是什么呢?但是,人的要求是无止境的……(省略本人感慨若干百字)。 把不同的对象链在一个链表中的目的是为了方便使用,现在一定记住这个原则,后面的讨论都是基于这个原则的,否则,我们就是技术狂人了——偏偏实现一些看起来不可能的事情。 达到这转载 2008-04-21 16:45:00 · 640 阅读 · 0 评论 -
选择排序
// LineList.cpp : selectSort. // #include "stdafx.h" #include using namespace std; void selectSort(int iArray[],int n); int _tmain(int argc, _TCHAR* argv[]) { int *arrayTest= new int[5]; arrayTest原创 2008-07-23 23:24:00 · 283 阅读 · 0 评论 -
数据结构常用算法
将一整数序列中的所有负数转移到所有正数之前 using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CSharpTest{ class Program { public static int[] Sort(int[] A)原创 2009-01-03 10:39:00 · 386 阅读 · 0 评论 -
二叉树相关算法
// CplusTest.cpp : Defines the entry point for the console application.#include "stdafx.h"#include "iostream"using namespace std;#define Max 20 //结点的最大个数 typedef struct BinTNode{ char data; st转载 2009-01-03 15:36:00 · 474 阅读 · 0 评论