text2-6.htm

来自「浙江大学计算机学院数据结构课程的教学课件」· HTM 代码 · 共 59 行

HTM
59
字号
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" link="#0000FF" vlink="#3399FF" alink="#FF0066">
<div id="Layer1" style="position:absolute; width:711px; height:21px; z-index:1; top: 10px; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000; left: 26px"><b>|</b><font face="宋体" size="2"><a href="../text1/text1-0.htm">第一章</a></font><b>|</b><font face="宋体" size="2">第二章</font><b>|</b><font face="宋体" size="2"><a href="../text3/text3-0.htm">第三章</a></font><b>|</b><font face="宋体" size="2"><a href="../text4/text4-0.htm">第四章</a></font><b>|</b><font face="宋体" size="2"><a href="../text5/text5-0.htm">第五章</a></font><b>|</b><font face="宋体" size="2"><a href="../text6/text6-0.htm">第六章</a></font><b>|</b><font face="宋体" size="2"><a href="../text7/text7-0.htm">第七章</a></font><b>|</b><font face="宋体" size="2"><a href="../text8/text8-0.htm">第八章</a></font><b>|</b><font face="宋体" size="2"><a href="../text9/text9-0.htm">第九章</a></font><b>|</b><font face="宋体" size="2"><a href="../text10/text10-0.htm">第十章</a></font><b>|</b><font size="2" face="宋体"><a href="../textA/textA-0.htm">算法分析</a><b><font color="#000000">|</font></b> 
  </font></div>
<pre align="left"><b><font face="Arial, Helvetica, sans-serif" size="4">
<font size="5" color="#FF0033">2.3 The Polynomial Abstract Data Type 
<font size="4" color="#0033CC">DEFINITION</font>    </font>
_____________________________________________________
Structure <font color="#FF0033">polynomial</font> is
	<font color="#0066FF"><i>object: </i></font><i>p(x) = a1 <img src="image/xe1.gif" width="22" height="20"> + … + an  </i><img src="image/xen.gif" width="24" height="17"> ; a set of ordered   pairs <i><font color="#FF0033">< ei, ai > </font></i>
                  where <i>ai</i>  in Coefficients and <i>ei</i>  in  Exponents are 
                  integers >= 0
	<font color="#0066CC"><i>function:</i></font>
                 for all <i>poly, poly1, poly2 <img src="image/Image4.gif" width="13" height="13">  Polynomial, coef <img src="image/Image4.gif" width="13" height="13">  Coefficients,
                 expon <img src="image/Image4.gif" width="13" height="13">  Exponents</i>

   <font color="#FF0099">Polynomial    Zero( )     </font>               ::=  return the polynomial, <i> p(x) = 0</i>
   <font color="#FF0099">Boolean IsZero(poly)</font>                  ::=  if (<i>poly</i>) return <i>FALSE</i>
                                                                          else return <i>TRUE</i>
   <font color="#FF0099">Coefficient Coef(poly,expon)  </font> ::=  if (expon<img src="image/Image4.gif" width="13" height="13"><i> poly</i> )
                                                                       return its coefficient
                                                                           else return zero
   <font color="#FF0099">Exponent Lead_Exp(poly) </font> ::=  return the largest exponent in <i>poly</i>
   <font color="#FF0099">Polynomial Attach(poly,coef,expon)</font>
                                                    ::=  if (expon<img src="image/Image4.gif" width="13" height="13"> <i>poly</i> ) return error
                                                             else return the polynomial<i> poly </i>
                                                             with the term<i>&lt;coef,expon&gt; </i>inserted
   <font color="#FF0099">Polynomial Remove(poly,expon) </font>
                                                    ::=  if ( expon<img src="image/Image4.gif" width="13" height="13"> <i>poly</i>)
                                                           return the polynomial <i>poly</i> with
                                                           the term  whose exponent is 
                                                               expon deleted		
   <font color="#FF0099">Polynomial SingleMult( poly,coef,expon)</font> ::= return the polynomial
                                                                                    <i>poly*c</i>oef * <img src="image/expon.gif" width="43" height="17"> 
<font color="#FF0099">   polynomial Add(poly1, poly2)</font>                      ::= return the polynomial
                                                                                    <i>poly1</i> + <i>poly2</i>
   <font color="#FF0099">Polynomial Mult(poly1, poly2)</font>                     ::=  return the polynomial
                                                                                     <i>poly1* poly2</i>
end <font color="#FF0033">Polynomial</font>	
____________________________________________________

</font></b><b><font face="Arial, Helvetica, sans-serif" size="4">
  </font></b></pre>
<table width="731" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="327">&nbsp;</td>
    <td width="271"><a href="../index.htm"><img width="60" height="25" usemap="#MapMap4" border="0" src="../../images/home.gif"></a><a href="../index.htm"><map name="MapMap4"><area shape="rect" coords="42,-34,88,-15" href="text0.htm"><area shape="rect" coords="4,4,55,23" href="text2-index.htm"></map></a></td>
    <td width="131"><font face="楷体_GB2312" size="2"><b><a href="text2-5.htm">上一页</a> 
      <a href="text2-7.htm">下一页</a></b></font></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?