数据结构严蔚敏C语言版 迷宫
文件大小: 2k
源码售价: 10 个金币 积分规则     积分充值
资源说明:数据结构 严蔚敏 C语言版 迷宫 status mazePath(seqStack *S, posType start, posType end) { posType curPos; //current positon int curStep; //the ordinary number sElemType e; curPos = start; curStep = 1; do { if(pass(curPos)) //the current position is "accessed" { footPrint(curPos); e.ord = curStep; e.seat = curPos; e.di = 1; push(S, e); if(curPos.xPos == end.xPos && curPos.yPos == end.yPos) { return OK; //arrive at the final } curPos = nextPos(curPos, 1); curStep++; }//end of if(pass(curPos)) else //the current position is not "accessed" { if(!stackEmpty(*S)) //the stack is not empty { pop(S,&e); while(e.di == 4 && !stackEmpty(*S)) { markPrint(e.seat); //the current position must be marked by '#' pop(S,&e); }//end while if(e.di < 4) { e.di++; push(S,e); curPos = nextPos(e.seat, e.di); } }//end of if(!stackEmpty(*S)) }//end of else }while(!stackEmpty(*S)); }
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。