急求C语言数据结构课程设计!!!!!
来源:百度知道 编辑:UC知道 时间:2024/05/25 15:55:54
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ML 500
struct node
{
char data[50];
struct node *lc,*rc;
};
char article[]={"Explosives, as we all know ,are things that can't get close to.Though it dosen't sound good,it plays an important part in our world.Nowadays ,almost everthing,is made using electricity.And coal is the most important resource to make electricity.Needless to say ,metal is taken from rocks.Regardless of coal or metal,we have to use explosives to get them.In a word,if we did't have explosives,we wouldn't have such a modern world."};
int offset=0;
struct node *tree,*root;
void inorder(struct node *ctree)
{
if(ctree->lc!=NULL)inorder(ctree->lc);
printf("%s ",ctree->data);
if(ctree->rc!=NULL)inorder(ctree->rc);
}
void AddIn(char word[])
{
int i=0,k; tree=root