十
設計思想
void SEARCH(BTREE BT)
{ stack S
elementtype p;
MAKENULL(S);
MAKENULL(R);
while(!ISEMPTY(T)||EMPTY(S))
{ if (!ISEMPTY(T))
{ push(T
T=LCHILD(T);
}
else
{ T=TOP(s);
POP(s);
push(DATA(T)
T=RCHILD(T);
}
}
while (!EMPTY(R))
{ p=TOP(R);
POP(R);
printf(R)
}
}
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23851.html