随笔分类 - 数据结构
摘要:``` / 用一个数组保存节点,前面n为叶子结点,因为哈夫曼树没有度为1的节点,所以总结点数为2 n 1,后面为组合的节点 / include using namespace std; typedef struct HTNODE{ int weight; int parent; int lchild
阅读全文
摘要://测试结点abd###ce##f###include<stdio.h>#include<stdlib.h>#include<string.h>#define MAXLENGTH 30typedef struct Binode{ char data; struct Binode *lchild; s
阅读全文
摘要:#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
阅读全文
摘要:#include<stdio.h>#include<stdlib.h>#define MAX_SIZE 100typedef struct{ int data[MAX_SIZE]; int front; int rear;}SeqQueue; void InitQueue(SeqQueue *Q){
阅读全文
摘要:#include<stdio.h>#include<stdlib.h>#define stack_initSize 100#define stack_incrementSize 10typedef struct{ int * stackdata; int top; int stacksize;}se
阅读全文
摘要:#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
阅读全文
摘要:#include<stdio.h>#include<string.h>#include<malloc.h>#include<stdlib.h>#define Max_SeqList 10 typedef struct{ int num; }Student; typedef struct{ Stude
阅读全文

浙公网安备 33010602011771号