⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page200.html

📁 Data Structures And Algorithms With Object-Oriented Design Patterns In Python (2003) source code and
💻 HTML
字号:
<HTML><HEAD><TITLE>Applications</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html3505" HREF="page201.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html3503" HREF="page190.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html3499" HREF="page199.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html3507" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION007240000000000000000">Applications</A></H2><P>In Section&nbsp;<A HREF="page189.html#seclistsapp1"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> we saw that an  <IMG WIDTH=21 HEIGHT=14 ALIGN=BOTTOM ALT="tex2html_wrap_inline57913" SRC="img94.gif"  >-order polynomial,<P> <IMG WIDTH=388 HEIGHT=44 ALIGN=BOTTOM ALT="displaymath61181" SRC="img768.gif"  ><P>where  <IMG WIDTH=47 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline61201" SRC="img769.gif"  >,can be represented by a sequence of ordered pairs thus:<P> <IMG WIDTH=375 HEIGHT=16 ALIGN=BOTTOM ALT="displaymath61398" SRC="img815.gif"  ><P>We also saw that it is possible to make use of an <em>ordered list</em>to represent such a sequenceand that given such a representation,we can write an algorithm to perform differentiation.<P>As it turns out,the order of the terms in the sequencedoes not affect the differentiation algorithm.The correct result is always obtainedand the running time is unaffectedregardless of the order of the terms in the sequence.<P>Unfortunately, there are operations on polynomialswhose running time depends on the order of the terms.For example, consider the addition of two polynomials:<P> <IMG WIDTH=541 HEIGHT=44 ALIGN=BOTTOM ALT="multline10303" SRC="img816.gif"  ><P>To perform the additionall the terms involving <I>x</I> raised to the same powerneed to be grouped together.<P>If the terms of the polynomials are in an arbitrary order,then the grouping together of the corresponding terms is time consuming.On the other hand,if the terms are ordered, say,from smallest exponent to largest,then the summation can be done rather more efficiently.A single pass through the polynomials will suffice.It makes sense to represent each of the polynomialsas a <em>sorted list</em> of terms using, say,the <tt>SortedListAsLinkedList</tt> class.<P><BR> <HR><UL> <LI> <A NAME="tex2html3508" HREF="page201.html#SECTION007241000000000000000">Implementation</A><LI> <A NAME="tex2html3509" HREF="page202.html#SECTION007242000000000000000">Analysis</A></UL><HR><A NAME="tex2html3505" HREF="page201.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html3503" HREF="page190.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html3499" HREF="page199.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html3507" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright &#169; 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

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