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

📄 page414.html

📁 Data Structures And Algorithms With Object-Oriented Design Patterns In Python (2003) source code and
💻 HTML
字号:
<HTML><HEAD><TITLE>Projects</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="tex2html5942" HREF="page415.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html5940" HREF="page386.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html5936" HREF="page413.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html5944" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION0012700000000000000000">Projects</A></H1><P><OL><LI>	Complete the <tt>SetAsArray</tt> class	introduced in Program&nbsp;<A HREF="page389.html#progsetAsArraya"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>	by providing suitable definitions for the following operations:	<tt>purge</tt>, <tt>getIsEmpty</tt>, <tt>getIsFull</tt>, <tt>getCount</tt>,	<tt>_compareTo</tt>, <tt>accept</tt>, and <tt>__iter__</tt>.	Write a test program and test your implementation.<LI>	Complete the <tt>SetAsBitVector</tt> class	introduced in Program&nbsp;<A HREF="page393.html#progsetAsBitVectora"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>	by providing suitable definitions for the following methods:	<tt>purge</tt>, <tt>getIsEmpty</tt>, <tt>getIsFull</tt>, <tt>getCount</tt>,	<tt>_compareTo</tt>, <tt>accept</tt>, and <tt>__iter__</tt>.	Write a test program and test your implementation.<LI>	Rewrite the <tt>insert</tt>, <tt>withdraw</tt>, and <tt>__contains__</tt>	methods 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 methods	with the original ones and explain your observations.<LI>	Complete the <tt>MultisetAsArray</tt> class	introduced in Program&nbsp;<A HREF="page397.html#progmultisetAsArraya"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>	by providing suitable definitions for the following methods:	<tt>purge</tt>, <tt>getCount</tt>,	<tt>_compareTo</tt>, <tt>accept</tt>, and <tt>__iter__</tt>.	Write a test program and test your implementation.<LI>	Complete the <tt>MultisetAsLinkedList</tt> class	introduced in Program&nbsp;<A HREF="page400.html#progmultisetAsLinkedLista"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>	by providing suitable definitions for the following methods:	<tt>purge</tt>, <tt>getIsEmpty</tt>, <tt>getIsFull</tt>, <tt>getCount</tt>,	<tt>_compareTo</tt>, <tt>accept</tt>, and <tt>iter</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_inline67347" SRC="img1675.gif"  >,	where <I>i</I> an the element of the universal set <I>U</I>	and  <IMG WIDTH=14 HEIGHT=14 ALIGN=MIDDLE ALT="tex2html_wrap_inline62243" SRC="img937.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="page413.html#exercisesetsmultiseti"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> and&nbsp;<A HREF="page413.html#exercisesetsmultisetii"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../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.	That is, compute  <IMG WIDTH=76 HEIGHT=27 ALIGN=MIDDLE ALT="tex2html_wrap_inline66995" SRC="img1607.gif"  >	where	<P> <IMG WIDTH=389 HEIGHT=67 ALIGN=BOTTOM ALT="displaymath67405" SRC="img1689.gif"  ><P>	<b>Hint</b>: See Section&nbsp;<A HREF="page460.html#secalgsbinom"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.</OL><P><HR><A NAME="tex2html5942" HREF="page415.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html5940" HREF="page386.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html5936" HREF="page413.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html5944" 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 + -