page232.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 39 行
HTML
39 行
<HTML><HEAD><TITLE>Implementation</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="tex2html3877" HREF="page233.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html3875" HREF="page231.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html3869" HREF="page231.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html3879" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION008511000000000000000">Implementation</A></H3><P>The <tt>ChainedScatterTable</tt> class is introducedin Program <A HREF="page232.html#progchainedScatterTablea"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.This class extends the abstract <tt>HashTable</tt> classintroduced in Program <A HREF="page223.html#proghashTablea"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.The scatter table is implemented as an array of <tt>Entry</tt> class instances.The <tt>Entry</tt> class is a <em>nested class</em><A NAME=11818> </A>defined within the <tt>ChainedScatterTable</tt> class.<P><P><A NAME="11952"> </A><A NAME="progchainedScatterTablea"> </A> <IMG WIDTH=575 HEIGHT=237 ALIGN=BOTTOM ALT="program11820" SRC="img955.gif" ><BR><STRONG>Program:</STRONG> <tt>ChainedScatterTable.Entry</tt> class <tt>__init__</tt> method.<BR><P><P>Each <tt>Entry</tt> instance has two instance attributes--<tt>_obj</tt> and <tt>_next</tt>.The former refers to an object.The latter indicates the position in the array of the next element of a chain.The value of the constant <tt>NULL</tt>will be used instead of zero to mark the end of a chain.The value zero is not used to mark the end of a chainbecause zero is a valid array subscript.<P><HR><A NAME="tex2html3877" HREF="page233.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html3875" HREF="page231.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html3869" HREF="page231.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html3879" 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 © 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 + =
减小字号Ctrl + -
显示快捷键?