随笔分类 -  数据结构

摘要:``` / 用一个数组保存节点,前面n为叶子结点,因为哈夫曼树没有度为1的节点,所以总结点数为2 n 1,后面为组合的节点 / include using namespace std; typedef struct HTNODE{ int weight; int parent; int lchild 阅读全文
posted @ 2018-10-31 14:00 Saruka的男朋友 阅读(302) 评论(0) 推荐(0)
摘要:图的邻接矩阵的深度优先搜索和广度优先搜索 阅读全文
posted @ 2017-11-30 15:48 Saruka的男朋友 阅读(295) 评论(0) 推荐(0)
摘要://测试结点abd###ce##f###include<stdio.h>#include<stdlib.h>#include<string.h>#define MAXLENGTH 30typedef struct Binode{ char data; struct Binode *lchild; s 阅读全文
posted @ 2017-11-13 22:28 Saruka的男朋友 阅读(149) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<stdlib.h>#define MAXLEN 100typedef struct{ char * vec; int length;}str; int StrLength(char* obj){//求串长 int i=0,n=0; while(ob 阅读全文
posted @ 2017-11-13 22:27 Saruka的男朋友 阅读(182) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<stdlib.h>#define MAX_SIZE 100typedef struct{ int data[MAX_SIZE]; int front; int rear;}SeqQueue; void InitQueue(SeqQueue *Q){ 阅读全文
posted @ 2017-11-13 22:26 Saruka的男朋友 阅读(163) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<stdlib.h>#define stack_initSize 100#define stack_incrementSize 10typedef struct{ int * stackdata; int top; int stacksize;}se 阅读全文
posted @ 2017-11-13 22:25 Saruka的男朋友 阅读(127) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>static struct stuNode *head=NULL;struct stuNode { char num[16]; char name[8]; char age[4]; str 阅读全文
posted @ 2017-11-13 22:24 Saruka的男朋友 阅读(111) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<string.h>#include<malloc.h>#include<stdlib.h>#define Max_SeqList 10 typedef struct{ int num; }Student; typedef struct{ Stude 阅读全文
posted @ 2017-11-13 22:22 Saruka的男朋友 阅读(113) 评论(0) 推荐(0)