数据结构
丁小未
热爱游戏开发,热爱Coding!
展开
-
二叉树的创建和操作
#include #include #define MaxSize 100 typedef struct node{ char data; /*此例中二叉树的结点采用字符类型*/ struct node *lchild,*rchild; }NODE; /*按先序遍历序列创建二叉树的二叉链表*/ NODE *crt_bt_pre(){ NODE *bt; char原创 2012-06-17 13:56:06 · 1622 阅读 · 1 评论 -
线性表的创建和操作
//对顺序表的操作 #include #include #include #define MAXSIZE 1000 typedef char ElemType; typedef struct { ElemType data[MAXSIZE]; int length; }SqList; //初始化线性表 void InitList(SqList*&L) { L原创 2012-06-17 13:58:37 · 7683 阅读 · 3 评论 -
链表的创建和操作
//链式结构 #include #include #include #define MAXSIZE 1000 typedef char ElemType; typedef struct LNode{//定义单链表结点类型 ElemType data; struct LNode *next; }LinkList; void InitList(LinkList *&L){原创 2012-06-17 14:02:12 · 1538 阅读 · 0 评论 -
图的操作
//图 #include #include #define MaxNum 100 typedef char Type; //邻接矩阵类型定义 typedef struct { Type vexs[MaxNum]; int edges[MaxNum][MaxNum]; int Vertex_num,edge_num; }MGraph; //邻接表类型定义 typ原创 2012-06-17 14:09:11 · 1362 阅读 · 0 评论 -
数据结构 排序和查找
#include #include #include const int ITEMNUM = 100; #define ElemType int //冒泡排序 void Bubblesort(ElemType R[],int n,int &comp_num,int &move_num) { int i,j,flag=1; //当flag为0,则停止排序 El原创 2012-06-17 14:12:52 · 1471 阅读 · 0 评论 -
Java对链表的操作
class LinkList { private class Node//创建节点类 { public Object item; public Node next; } private Node head; private Node slider; private int count; public LinkList()//构造方法 { c转载 2012-12-17 15:16:46 · 1294 阅读 · 0 评论 -
A*寻路算法的lua实现
前言:又好久没写blog了,感觉有点“颓废”了,最近认识好多好多同龄人,也是大学刚毕业,觉得他们很优秀,认识到自己跟他们的差距,有点自愧不如。没写blog当然也有一部分原因是因为工作,本来经验就有点欠缺,还要承担起一个项目的压力,原本国庆回去就要把这个寻路的功能改进一下,结果第一次去女朋友家了就没碰电脑,回上海来的第一个夜晚满脑子全是心事,早上凌晨四点就在床上辗转睡不着了,这个月随着项目的进行感觉原创 2014-10-12 15:35:14 · 10032 阅读 · 5 评论 -
C#版的数据结构(对链表的操作)
我们一般只是学过C/C++的数据结构,想必学C#的学生会疑惑,为什么C#没有数据结构呢,那我来告诉你,其实C#也是有数据结构的,只不过我们不了解罢了,经过我半天的编程,终于把C#的数据结构写出来了,也大大增加了我对数据结构的理解,在这里提供出来,共享学习,共同进步! using System; using System.Collections.Generic; using System原创 2012-12-16 12:17:39 · 6811 阅读 · 0 评论