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

📄 page198.html

📁 wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq
💻 HTML
字号:
<HTML>
<HEAD>
<TITLE>Applications</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
 <img src="cover75.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cover75.gif" alt="Logo" align=right>
<b>Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++</b><br>
<A NAME="tex2html4357" HREF="page199.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page199.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html4355" HREF="page188.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page188.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html4351" HREF="page197.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page197.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html4359" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html4360" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <BR><HR>
<H2><A NAME="SECTION008240000000000000000">Applications</A></H2>
<P>
In Section&nbsp;<A HREF="page187.html#seclistsapp1" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page187.html#seclistsapp1"><IMG  ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cross_ref_motif.gif"></A> we saw that an  <IMG WIDTH=21 HEIGHT=13 ALIGN=BOTTOM ALT="tex2html_wrap_inline58453" SRC="img94.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img94.gif"  >-order polynomial,
<P> <IMG WIDTH=387 HEIGHT=43 ALIGN=BOTTOM ALT="displaymath61822" SRC="img815.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img815.gif"  ><P>
where  <IMG WIDTH=45 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline61842" SRC="img816.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img816.gif"  >,
can be represented by a sequence of ordered pairs thus:
<P> <IMG WIDTH=375 HEIGHT=16 ALIGN=BOTTOM ALT="displaymath61823" SRC="img819.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img819.gif"  ><P>
We also saw that it is possible to make use of an <em>ordered list</em>
to represent such a sequence
and 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 sequence
does not affect the differentiation algorithm.
The correct result is always obtained
and the running time is unaffected
regardless of the order of the terms in the sequence.
<P>
Unfortunately, there are operations on polynomials
whose running time depends on the order of the terms.
For example, consider the addition of two polynomials:
<P> <IMG WIDTH=574 HEIGHT=18 ALIGN=BOTTOM ALT="displaymath62024" SRC="img861.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img861.gif"  ><P>
To perform the addition
all the terms involving <I>x</I> raised to the same power
need 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 polynomials
as a <em>sorted list</em> of terms using, say,
the <tt>SortedListAsLinkedList</tt> class.
<P>
<BR> <HR>
<UL> 
<LI> <A NAME="tex2html4361" HREF="page199.html#SECTION008241000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page199.html#SECTION008241000000000000000">Implementation</A>
<LI> <A NAME="tex2html4362" HREF="page200.html#SECTION008242000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page200.html#SECTION008242000000000000000">Analysis</A>
</UL>
<HR><A NAME="tex2html4357" HREF="page199.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page199.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html4355" HREF="page188.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page188.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html4351" HREF="page197.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page197.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html4359" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html4360" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <P><ADDRESS>
<img src="bruno.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/bruno.gif" alt="Bruno" align=right>
<a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html">Copyright &#169; 1997</a> by <a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.

</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

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