C数据结构:栈 功能:递推关系用栈和递归实现(二)

2014-11-23 23:39:57 · 作者: · 浏览: 41
}

103 PrintT(SD);

104 Destroy(&SD);

105 return OK;

106 }

107

108 int Reserve(Stack S, LinkStack SR)//栈的倒置

109 {

110 Type e;

111 if (Isempty(S))

112 return ERROR;

113 while (!Isempty(S))

114 {

115 if (Pop(&S, &e))

116 Push(SR, e);

117 }

118 return OK;

119 }