阅读下列算法,简述其功能。
1.voidDemol(SeqStack*S){
inti,arr[64],n=0;
while(!StackEmpty(S))arr[n++]=Pop(S);
for(i=0;i
2.SeqStackS1,S2,tmp;
DataTypeX;
…//假设栈tmp和S2已做过初始化
while(!StackEmpty(&S1))

X=Pop

欢迎免费使用小程序搜题/刷题/查看解析,提升学历,成考自考报名,论文代写、论文查重请加客服微信skr-web

阅读下列算法,简述其功能。
1.voidDemol(SeqStack*S){
inti,arr[64],n=0;
while(!StackEmpty(S))arr[n++]=Pop(S);
for(i=0;i
2.SeqStackS1,S2,tmp;
DataTypeX;
…//假设栈tmp和S2已做过初始化
while(!StackEmpty(&S1))

X=Pop(&&S1);
Push(trap,x);
)
while(!StackEmpty(&tmp))
{
x=Pop(&tmp);
Push(g>S1,x);
Push(&>S2,x);
}
3.voidDemo2(SeqStack*S,intm)
{//设DataType为int型
SeqStackT;inti;
InitStack(&T);
while(!StackEmpty(S))
if((i=Pop(S))!=m)Push(&T,i);
while(!StackEmpty(&T))
{
i=Pop(&T);Push(S,i);
}

1.当栈不为空时,将栈中元素逆置。 2.复制栈S1到S2。 3.删除栈S中元素m。

访客
邮箱
网址

通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作


  • 自动写文案
  • 自动写小说
  • 马上扫码让Ai帮你完成工作
通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作

  • 自动写论文
  • 自动写软件
  • 我不是人,但是我比人更聪明,我是强大的Ai
Top