page132.html

来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 34 行

HTML
34
字号
<HTML><HEAD><TITLE>Array 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="tex2html2730" HREF="page133.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2728" HREF="page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2722" HREF="page131.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html2732" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION006110000000000000000">Array Implementation</A></H2><P>This section describes an array-based implementation of stacks.Program&nbsp;<A HREF="page132.html#progstackAsArraya"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> introduces the <tt>StackAsArray</tt> class.The <tt>StackAsArray</tt> class is a concrete classthat extends the abstract <tt>Stack</tt> class defined in Program&nbsp;<A HREF="page131.html#progstacka"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.<P><P><A NAME="5634">&#160;</A><A NAME="progstackAsArraya">&#160;</A> <IMG WIDTH=575 HEIGHT=237 ALIGN=BOTTOM ALT="program5243" SRC="img660.gif"  ><BR><STRONG>Program:</STRONG> <tt>StackAsArray</tt> <tt>__init__</tt> and <tt>purge</tt> methods.<BR><P><BR> <HR><UL> <LI> <A NAME="tex2html2733" HREF="page133.html#SECTION006111000000000000000">Instance Attributes</A><LI> <A NAME="tex2html2734" HREF="page134.html#SECTION006112000000000000000"><tt>__init__</tt> and <tt>purge</tt> Methods</A><LI> <A NAME="tex2html2735" HREF="page135.html#SECTION006113000000000000000"><tt>push</tt>, <tt>pop</tt>, and <tt>getTop</tt>  Methods</A><LI> <A NAME="tex2html2736" HREF="page136.html#SECTION006114000000000000000"><tt>accept</tt> Method</A><LI> <A NAME="tex2html2737" HREF="page137.html#SECTION006115000000000000000"><tt>__iter__</tt> Method</A></UL><HR><A NAME="tex2html2730" HREF="page133.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2728" HREF="page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2722" HREF="page131.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html2732" 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 + =
减小字号Ctrl + -
显示快捷键?