📄 page152.html
字号:
<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="tex2html2958" HREF="page153.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2956" HREF="page147.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2950" HREF="page151.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html2960" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION006220000000000000000">Linked-List Implementation</A></H2><P>This section presents a queue implementationwhich makes use of the singly-linked list data structure, <tt>LinkedList</tt>,that is defined in Chapter <A HREF="page81.html#chapfds"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.Program <A HREF="page152.html#progqueueAsLinkedLista"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> introducesthe <tt>QueueAsLinkedList</tt> class.The <tt>QueueAsLinkedList</tt> extends the abstract <tt>Queue</tt> class.<P><P><A NAME="6789"> </A><A NAME="progqueueAsLinkedLista"> </A> <IMG WIDTH=575 HEIGHT=218 ALIGN=BOTTOM ALT="program6666" SRC="img696.gif" ><BR><STRONG>Program:</STRONG> <tt>QueueAsLinkedList</tt> class <tt>__init__</tt> and <tt>purge</tt> methods.<BR><P><BR> <HR><UL> <LI> <A NAME="tex2html2961" HREF="page153.html#SECTION006221000000000000000">Instance Attributes</A><LI> <A NAME="tex2html2962" HREF="page154.html#SECTION006222000000000000000"><tt>__init__</tt> and <tt>purge</tt> Methods</A><LI> <A NAME="tex2html2963" HREF="page155.html#SECTION006223000000000000000"><tt>enqueue</tt>, <tt>dequeue</tt> and <tt>getHead</tt> Methods</A></UL><HR><A NAME="tex2html2958" HREF="page153.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2956" HREF="page147.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2950" HREF="page151.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html2960" 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -