/* 先序 */
inorder(bitree root)
{
initstack(s);
p=root;
s.push(p);
while(!isempty(s))
{
visit(s.top);
s.pop(&p);
if(p-r) s.push(p-r);
if(p-l) s.push(p-l);
}
}
/* 中序 */
inorder(bitree root)
{
initstack(s);
p=root;
while(p!=NULL!isempty(s))
{
if(p!=NULL)
{
s.push(p);
p=p->l;
}
else
{
s.pop(&p)
visit(p);
p=p->r;
}
}
}
int visit[NUM]={0};
void TraverGraph(Graph g)
{
for(int i=0;i<NUM;i++)
if(!visit[i]) DepthVisit(g,i);
}
DepthVisit(Graph g,int i)
{
visitadj(i);
visit[i]=1;
int w=fistAdj(g,i);
while(w!=-1)
{
if(!visit[w]) DepthVisit(g,w);
w=nextadj(g,i,w);
}
}