haffman编码

#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_INT 99999//哈夫曼树和哈夫曼编码的存储表示typedef struct{ int weight; int parent,lchild,rchild;} HTNode,*HuffmanTree; // 动态分配数组存储哈夫曼树typedef char **HuffmanCode; // 动态分配数组存储哈夫曼编码表int min(HuffmanTree t,int i){ int j,flag; int k=MAX_I...

shellsort&amp;quiksort

#include<stdio.h>#include<stdlib.h>#include<time.h>int length;int j=1;//快速排序的趟数;void clear(){ char ch; do{ch=getchar();} while(ch!='\n');}//////////////////////////////////////////////////////////////////////////////int Partition(int *r, int low, int high){ //printf("第%d趟排序初始位置low:%...

使用队求解迷宫最短路径

#include <stdio.h>#include <stdlib.h>#define MAXQSIZE 64#define INCREMENT 16typedef struct node1{ int x; int y;} seat;typedef struct node2{ int pre; seat pos;} quequetype;typedef struct node3{ quequetype *base; int front; int rear; int size;} Queueptr;char maze[1000][1000]...

使用栈求解迷宫

#include<stdio.h>#include<time.h>#include<stdlib.h>#define DOWN 1#define LEFT 2#define UP 3#define RIGHT 4#define INITSTACKSIZE 100#define INCREMENTSIZE 10#define MARK 5#define BLIND_ALLEY 6typedef int ** MazeType;MazeType Maze;int Maze_Line,Maze_Column;typedef struct{ int x; int...
浏览70037次