- 博客(9)
- 收藏
- 关注
原创 第就章第21题(赶出来的作业) POWERBY KTL
//第九章第21题,交换左右子树;//输入参考书本p194,图9-8,输入为ABCDEFG@@@@L@@@#;中序遍历结果应该为DBEALFCG;//交换左右子树后进行中序遍历的结果应为:GCFLAEBD;//可以用别的二叉树进行验证;若程序出错的话可能是没有设置好maxsize的值;#include "stdio.h"#include "stdlib.h"#include "conio.h"#d
2006-05-30 22:33:00 576
原创 第九章第14题(赶出来的作业) POWERBY KTL
//第九章第14题;//假设十个符号为ABCDEFGHIJ,权值为8,21,37,24,6,18,23,41,56,14;//输入权值:8回车;//输入数据:A(不用回车);//输入十个权值和数据后,输出为:A 11001 ;B 1011 ;C 101 ;D 100 ;E 01001 ;(E权值最小编码最长)//F 0011;G 000 ;H 111//I 10 ;(I权值最大,编码最短)J 00
2006-05-30 22:03:00 995 1
原创 第九章第十七题(赶出来的作业) powerby ktl
//第九章第17题;用非递归算法设计先序遍历二叉树;#include "stdio.h"#include "conio.h"#include "stdlib.h"#define N 15 //需要设置栈的最大值,若二叉树深度为四,则设置2^4-1=15;#define maxsize 15 //本程序根据书本p194,图9-8,输入数据为ABCDEFG@@@@L@@@#,输出为先序排列:AB
2006-05-30 21:49:00 659
原创 第8章第11题的完整程序(Powered by biggates)
由于篇幅比较长,请访问http://spaces.msn.com/biggates/blog/cns!715707C35A631274!279.entry
2006-05-26 17:39:00 706
原创 第八章十一题,修改了 ,用单链表实现str.(不好意思又看错条件了,这次没有错误了。)powerby KTL
#include "stdio.h"#include "stdlib.h"#include "string.h"typedef char datatype;typedef struct node{ datatype data; struct node * pNext;}linklist;void PUSHL(linklist **S,datatype e){ linklist *p;
2006-05-26 17:32:00 521
原创 第八章十一题powerby spritsq
////8_11 判断字符串是否是对称的#include #include #include #include #define MAXSIZE 1024typedef char datatype;struct stack{ datatype elements[MAXSIZE]; int top;};struct node{ char data; struct node *next;}
2006-05-26 17:19:00 628
原创 第八章十六题修改后POWERBY KTL
#include "stdio.h"#include "stdlib.h"#include "string.h"#include "conio.h"#define M 10typedef char datatype;typedef struct{ datatype data[M]; int rear,quelen;}sequeue;void SETNULLQS(sequeue *sq){ sq
2006-05-26 16:31:00 564
原创 第8章第16题的完整程序(Powered by biggates)
/// 8_16.cpp : 假设以数组sequ[m]存放循环队列的元素,同时设变量/// rear 和quelen 分别指示循环队列中队尾元素的位置和内含元素的个数。/// 试给出判别此循环队列的队满条件,并写出相应的入队列和出队列的算法。/// 说明:本程序之所以不用typedef 把char定义成datatype,是因为:/// 在C语言中没有输入输出的重构函数,所以即使
2006-05-26 16:28:00 1101
原创 第八章十一题修改后(用栈实现)POWERBY KTL
#include "stdio.h"#include "stdlib.h"#include "string.h"typedef char datatype;typedef struct node{ datatype data; struct node * pNext;}linklist;void PUSHL(linklist **S,datatype e){ linklist *p;
2006-05-26 15:41:00 619
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人