page138.html
来自「wqeqwvrw rkjqhwrjwq jkhrjqwhrwq jkhrwq」· HTML 代码 · 共 44 行
HTML
44 行
<HTML>
<HEAD>
<TITLE>Linked List Implementation</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<img src="cover75.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cover75.gif" alt="Logo" align=right>
<b>Data Structures and Algorithms
with Object-Oriented Design Patterns in C++</b><br>
<A NAME="tex2html3615" HREF="page139.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page139.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html3613" HREF="page131.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html3607" HREF="page137.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page137.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html3617" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html3618" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <BR><HR>
<H2><A NAME="SECTION007120000000000000000">Linked List Implementation</A></H2>
<A NAME="secstackslinked"> </A>
<P>
In this section we will examine a
pointer-based implementation of stacks
that makes use of the <tt>LinkedList<T></tt>
data structure developed in Chapter <A HREF="page79.html#chapfds" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page79.html#chapfds"><IMG ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cross_ref_motif.gif"></A>.
Program <A HREF="page138.html#progstack3h" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page138.html#progstack3h"><IMG ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/cross_ref_motif.gif"></A> gives the declaration
of the concrete object class <tt>StackAsLinkedList</tt>
and its associated iterator, <tt>StackAsLinkedList::Iter</tt>.
As in the preceding section,
the function prototypes for the interface inherited from the
<tt>Container</tt> base class have been elided for the sake of brevity.
Of course, implementations must be provided for
all of the inherited member functions which
are declared pure in the base class.
<P>
<P><A NAME="6295"> </A><A NAME="progstack3h"> </A> <IMG WIDTH=575 HEIGHT=371 ALIGN=BOTTOM ALT="program5997" SRC="img717.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/img717.gif" ><BR>
<STRONG>Program:</STRONG> <tt>StackAsLinkedList</tt> Class Definition<BR>
<P><BR> <HR>
<UL>
<LI> <A NAME="tex2html3619" HREF="page139.html#SECTION007121000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page139.html#SECTION007121000000000000000">Member Variables</A>
<LI> <A NAME="tex2html3620" HREF="page140.html#SECTION007122000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page140.html#SECTION007122000000000000000">Constructor and Destructor</A>
<LI> <A NAME="tex2html3621" HREF="page141.html#SECTION007123000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page141.html#SECTION007123000000000000000"><tt>Push</tt>, <tt>Pop</tt>, and <tt>Top</tt> Member Functions</A>
<LI> <A NAME="tex2html3622" HREF="page142.html#SECTION007124000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page142.html#SECTION007124000000000000000">The <tt>Accept</tt> Member Function</A>
<LI> <A NAME="tex2html3623" HREF="page143.html#SECTION007125000000000000000" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page143.html#SECTION007125000000000000000">Iterator</A>
</UL>
<HR><A NAME="tex2html3615" HREF="page139.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page139.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="next_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/next_motif.gif"></A> <A NAME="tex2html3613" HREF="page131.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page131.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="up_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/up_motif.gif"></A> <A NAME="tex2html3607" HREF="page137.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page137.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/previous_motif.gif"></A> <A NAME="tex2html3617" HREF="page9.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page9.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/contents_motif.gif"></A> <A NAME="tex2html3618" HREF="page620.html" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/html/page620.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="index_motif.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/index_motif.gif"></A> <P><ADDRESS>
<img src="bruno.gif" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/icons/bruno.gif" alt="Bruno" align=right>
<a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/copyright.html">Copyright © 1997</a> by <a href="javascript:if(confirm('http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html'" tppabs="http://dictator.uwaterloo.ca/Bruno.Preiss/books/opus4/signature.html">Bruno R. Preiss, P.Eng.</a> All rights reserved.
</ADDRESS>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?