#include<stdio.h>#include<conio.h>#include<math.h>#define OVERFLOW -2#define OK 1typedef struct LNode{ float coef; int expn; struct LNode *next;}LNode,*Linklist;int initlist(LNode *L){ L=(LNode *)malloc(sizeof(LNode)); if(!L)exit(OVERFLOW); L->next=NULL; return OK;}int Creat...
#include<stdio.h>#define n 5int huan(int *a){ int i,j,t,m; i=0; j=n-1; t=a[0]; while(i<j) { while(i<j&&a[j]>0) j--; if(i<j) a[i++]=a[j]; while(i<j&&a[i]<0) i++; if(i<j) a[j--]=a[i]; } a[i]=t; for(m=0;m<...
#include<stdio.h>#include<stdlib.h>int leafcount=0;typedef struct BiTNode{ char data; struct BiTNode *lchild,*rchild;}BiTNode,*BiTree;int CreateBiTree(BiTree *T)/*根据先序序列建立二叉树的二叉链表*/{ char ch; scanf("%c",&ch); if(ch=='-') { *T=NULL; } else{ if(!(*T=(Bi...
#include<stdio.h>#include<conio.h>#include<math.h>#define OVERFLOW -2#define OK 1typedef struct LNode{ float coef; int expn; struct LNode *next;}LNode,*Linklist;int initlist(LNode *L){ L=(LNode *)malloc(sizeof(LNode)); if(!L)exit(OVERFLOW); L->next=NULL; return OK;}int Creatl...
#include<stdio.h>typedef char Datatype;typedef struct BiTNode { Datatype data; struct BiTNode *lchild, *rchild;} BiTNode, *BiTree;void CreateBiTree(BiTree *T) { char ch; scanf("%c",&ch); if(ch=='#') (*T)=NULL; else { (*T)=(BiTree)malloc(sizeof(BiTNod...