
数据结构作业
realfancy
这个作者很懒,什么都没留下…
展开
-
线性表(顺序表和链式表)
#include<iostream>#include<cstdio>#define LIST_INIT_SIZE 100 //初始数量#define LISTINCREMENT 10 //增加量#define LA_INITLEN 3 //La初始长度#define LB_INITLEN 4 //Lb初始长度typede原创 2017-12-17 12:27:48 · 721 阅读 · 0 评论 -
对称矩阵压缩和三种解压缩方式
#include<iostream>#include<stdio.h>#include<math.h>#define SIZE 5using namespace std;int* Compress(int *m) { int*n = (int*)malloc(sizeof(int)*(SIZE*(SIZE+1)/2)); int i = 0; int j = 0;原创 2017-12-17 12:30:12 · 2063 阅读 · 0 评论 -
顺序栈、链栈已及队列的实现
#include<iostream>#define STACK_INIT_SIZE 100#define STACKINCREMENT 10#define QUEUE_INIT_SIZE 100#define MAXSIZE 100typedef int SElemType;typedef int QElemType;//typedef int Status;enum Status{原创 2017-12-17 12:32:02 · 266 阅读 · 0 评论 -
二叉树的基本操作
(1)二叉树的创建(2)对进行先,中,后序遍历// Bitree.cpp: 定义控制台应用程序的入口点。//#include<iostream>#include<stdio.h>using namespace std;typedef char TElemType;enum Status { OK = 1,ERROR = 0 };//枚举类型typedef struct BiTNode{/原创 2017-12-17 12:36:50 · 227 阅读 · 0 评论 -
线索二叉树的基本操作
(1)二叉树的线索化(2)对线索二叉树进行中序遍历#include<iostream>using namespace std;typedef char TElemType;enum Status {OK = 1,ERROR = 0};enum PointerTag{Link = 0,Thread = 1};//typedef struct BiTNode {// TElemType dat原创 2017-12-17 12:39:08 · 567 阅读 · 0 评论 -
prim算法
普里姆算法#include<stdio.h>#include<stdlib.h>#define INFINITY INT_MAX#define MAX_VERTEX_NUM 20typedef enum {DG,DN,UDG,UDN}GraphKind;typedef enum {ERROR,OK}Status;typedef int VRType;typedef int Vertex原创 2017-12-17 12:41:39 · 630 阅读 · 0 评论