page415.html

来自「wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq」· HTML 代码 · 共 68 行

HTML
68
字号
<HTML>
<HEAD>
<TITLE>Projects</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="tex2html7047" HREF="page416.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page416.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="tex2html7045" HREF="page387.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page387.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="tex2html7041" HREF="page414.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page414.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="tex2html7049" 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="tex2html7050" 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>
<H1><A NAME="SECTION0013700000000000000000">Projects</A></H1>
<P>
<OL><LI>
	Complete the <tt>SetAsArray</tt> class
	declared in Program&nbsp;<A HREF="page390.html#progbitset1h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page390.html#progbitset1h"><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>
	by providing suitable definitions for the following member functions:
	<tt>SetAsArray</tt> (destructor), <tt>Purge</tt>,
	<tt>IsEmpty</tt>, <tt>IsFull</tt>, <tt>Count</tt>,
	<tt>Accept</tt>, and <tt>NewIterator</tt>.
	Write a test program and test your implementation.<LI>
	Complete the <tt>SetAsBitVector</tt> class
	declared in Program&nbsp;<A HREF="page394.html#progbitset2h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page394.html#progbitset2h"><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>
	by providing suitable definitions for the following member functions:
	<tt>SetAsBitVector</tt> (destructor), <tt>Purge</tt>,
	<tt>IsEmpty</tt>, <tt>IsFull</tt>, <tt>Count</tt>,
	<tt>Accept</tt>, and <tt>NewIterator</tt>.
	Write a test program and test your implementation.<LI>
	Rewrite the <tt>Insert</tt>, <tt>Withdraw</tt> and <tt>IsMember</tt>
	member functions of the <tt>SetAsBitVector</tt> implementation
	so that they use bitwise shift and mask operations
	rather than division and modulo operations.
	Compare the running times of the modified routines
	with the original ones and explain your observations.<LI>
	Complete the <tt>MultisetAsArray</tt> class
	declared in Program&nbsp;<A HREF="page398.html#progmultiset2h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page398.html#progmultiset2h"><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>
	by providing suitable definitions for the following member functions:
	<tt>MultisetAsArray</tt> (destructor), <tt>Purge</tt>,
	<tt>Count</tt>, <tt>Accept</tt>, and <tt>NewIterator</tt>.
	Write a test program and test your implementation.<LI>
	Complete the <tt>MultisetAsLinkedList</tt> class
	declared in Program&nbsp;<A HREF="page401.html#progmultiset3h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page401.html#progmultiset3h"><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>
	by providing suitable definitions for the following member functions:
	<tt>SetAsArray</tt> (destructor), <tt>Purge</tt>,
	<tt>IsEmpty</tt>, <tt>IsFull</tt>, <tt>Count</tt>,
	<tt>CompareTo</tt>, <tt>Accept</tt>, and <tt>NewIterator</tt>.
	Write a test program and test your implementation.<LI>
	Design and implement a multiset class
	in which the contents of the set are represented by
	a linked list of ordered pairs of the form  <IMG WIDTH=38 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline67958" SRC="img1724.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1724.gif"  >,
	where <I>i</I> an the element of the universal set <I>U</I>
	and  <IMG WIDTH=13 HEIGHT=15 ALIGN=MIDDLE ALT="tex2html_wrap_inline62818" SRC="img972.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img972.gif"  > is a non-negative integer that counts the number
	of instances of the element <I>i</I> in the multiset.
	(See Exercises&nbsp;<A HREF="page414.html#exercisesetsmultiseti" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page414.html#exercisesetsmultiseti"><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> and&nbsp;<A HREF="page414.html#exercisesetsmultisetii" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page414.html#exercisesetsmultisetii"><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>).<LI>
	Write a program to compute the number of ways
	in which a set of <I>n</I> elements can be partitioned.
	I.e., compute  <IMG WIDTH=76 HEIGHT=27 ALIGN=MIDDLE ALT="tex2html_wrap_inline67606" SRC="img1653.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1653.gif"  >
	where
	<P> <IMG WIDTH=389 HEIGHT=66 ALIGN=BOTTOM ALT="displaymath68016" SRC="img1738.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img1738.gif"  ><P>
	<b>Hint</b>: See Section&nbsp;<A HREF="page467.html#secalgsbinom" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page467.html#secalgsbinom"><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>.
</OL>
<P>
<HR><A NAME="tex2html7047" HREF="page416.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page416.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="tex2html7045" HREF="page387.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page387.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="tex2html7041" HREF="page414.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page414.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="tex2html7049" 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="tex2html7050" 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 + =
减小字号Ctrl + -
显示快捷键?