摘要:
// aaa.h //#include<iostream>using namespace std;typedef struct {int i,j,e;}Triple;typedef struct{Triple data[30];int mu,nu,tu;}TSMtatrix;TSMtatrix Init(TSMtatrix &M)//初始化三元组顺序表{M.mu=5;M.nu=5;M.tu=0;M.data[0].i=0;M.data[0].j=0;M.data[0].e=1;return M;}TSMtatrix houyi(TSMtatrix &M,int k) 阅读全文
摘要:
// bbb.h //#include<iostream>using namespace std;typedef struct {int * elem;int front;int rear;int queuesize;}sqQueue;void init_sq(sqQueue &q, int maxsize){q.elem=new int[maxsize-1];q.queuesize=maxsize;q.front=q.rear=0;}bool delete_sq(sqQueue &q , int & e){int m=0;for(int i=0;i< 阅读全文
摘要:
// hhh.cpp //#include"hhh.h"void transform(char *suffix , string s){LinkStack S;InitStack(S);char ch,c;push_stack(S,'#');istringstream iss(s);iss>>ch;int k=0; //cout<<"iss:"<<ch<<endl;while(!stackempty(S)){if(!OpMember(ch)) suffix[k++]=ch;//cout< 阅读全文
摘要:
//stack.h//#include<iostream>using namespace std;typedef int ElemType;typedef struct NodeType{ElemType data;NodeType *next;}NodeType,*LinkStack; void InitStack(LinkStack &S) //初始化栈{S=NULL;} //InitListbool pop_stack(LinkStack &S, ElemType &e) //出栈{NodeType *p;p=new NodeType;if(S){p= 阅读全文