经典指数          
原因
507
浏览数
0
收藏数
 

编写将栈S中所有值为e的数据元素删除的算法。

     举报   纠错  
 
切换
1 个答案
Status  algo2  (Stack &S, int e)   { Stack  &T; int d; while  (! StackEmpty (S))  { Pop (&S, &d); if (d!=e)   Push(&T,d); } while (!StackEmpty(T))   { Pop (&T, &d); Push(&S, d); } }
 
切换
撰写答案
扫描后移动端查看本题