page138.html

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

HTML
38
字号
<HTML><HEAD><TITLE>Linked-List 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="tex2html2799" HREF="page139.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2797" HREF="page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2791" HREF="page137.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html2801" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION006120000000000000000">Linked-List Implementation</A></H2><A NAME="secstackslinked">&#160;</A><P>In this section we will examine alinked-list implementation of stacksthat makes use of the <tt>LinkedList</tt>data structure developed in Chapter&nbsp;<A HREF="page81.html#chapfds"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.Program&nbsp;<A HREF="page138.html#progstackAsLinkedLista"><IMG  ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> introduces the <tt>StackAsLinkedList</tt> class.The <tt>StackAsLinkedList</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="5653">&#160;</A><A NAME="progstackAsLinkedLista">&#160;</A> <IMG WIDTH=575 HEIGHT=218 ALIGN=BOTTOM ALT="program5399" SRC="img670.gif"  ><BR><STRONG>Program:</STRONG> <tt>StackAsLinkedList</tt> <tt>__init__</tt> and <tt>purge</tt> methods.<BR><P><BR> <HR><UL> <LI> <A NAME="tex2html2802" HREF="page139.html#SECTION006121000000000000000">Instance Attributes</A><LI> <A NAME="tex2html2803" HREF="page140.html#SECTION006122000000000000000"><tt>__init__</tt> and <tt>purge</tt> Methods</A><LI> <A NAME="tex2html2804" HREF="page141.html#SECTION006123000000000000000"><tt>push</tt>, <tt>pop</tt> and <tt>getTop</tt> Methods</A><LI> <A NAME="tex2html2805" HREF="page142.html#SECTION006124000000000000000"><tt>accept</tt> Method</A><LI> <A NAME="tex2html2806" HREF="page143.html#SECTION006125000000000000000"><tt>__iter__</tt> Method</A></UL><HR><A NAME="tex2html2799" HREF="page139.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2797" HREF="page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2791" HREF="page137.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html2801" 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 + -
显示快捷键?