📄 ds3.4习题.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>数 据 结 构</title>
<meta name="Microsoft Theme" content="hounk 010">
</head>
<body background bgcolor="#000099" text="#CCCC99" link="#FF9900" vlink="#996600" alink="#FF3300">
<!--mstheme--><font face="宋体">
<p:colorscheme
colors="#0000FF,#FFFFFF,#000000,#FFCC66,#00FFFF,#3366FF,#FF0033,#FFFF00"/>
<p align="center"><b><font face="oúì?,SimHei" lang="ZH-CN" color="#FFFFFF" size="6">第三章习题</font></b></p>
<p><font color="#FFFFFF"><span lang="EN-US"><b><font size="5">4.<span style="font-style: normal; font-variant: normal; font-family: Times New Roman">
</span></font></b></span><b><font size="5"><span style="font-family:宋体;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:
"Times New Roman"">写一个算法,借助于栈将一个单链表置逆。</span></font></b></font></p>
<p class="MsoNormal" align="left"><font color="#FFFFFF"><b><font size="5"><span style="font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"">解答:</span></font></b></font></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span lang="EN-US" style="mso-bidi-font-size:10.0pt;font-family:"Times New Roman"">Status
Link_reverse(</span></font></b><font size="5" color="#FFFFFF"><b><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">Linklist
L,</span>SeqStack *s</b></font><b><font size="5" color="#FFFFFF"><span lang="EN-US" style="mso-bidi-font-size:10.0pt;font-family:"Times New Roman"">)</span><span lang="EN-US" style="mso-bidi-font-size:10.0pt;font-family:"Times New Roman""><br>
{<br>
Inistack(s);</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
P=L->next;</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
</span><span lang="EN-US" style="mso-bidi-font-size:10.0pt;font-family:"Times New Roman"">while(P); <br>
{<br>
push(s,P->data);<br>
P=P->next;<br>
}<br>
r=L->next;</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
while(!Empty_stack(s))</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
{</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
r->data=pop(s);</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
r=r->next;</span></font></b></p>
<p class="MsoNormal" align="left" style="margin-top: 0; margin-bottom: 0"><b><font size="5" color="#FFFFFF"><span style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman" lang="EN-US">
}</span><span lang="EN-US" style="mso-bidi-font-size:10.0pt;font-family:"Times New Roman""><br>
return OK;<br>
}</span></font></b></p>
<p class="MsoNormal" align="center"><a href="ds3习题.HTM"><b><font size="5" color="#FFFF00">返回</font></b></a></p>
<!--mstheme--></font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -