page81.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 58 行
HTML
58 行
<HTML><HEAD><TITLE>Foundational Data Structures</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="tex2html2134" HREF="page82.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2132" HREF="book.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2126" HREF="page80.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html2136" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION004000000000000000000">Foundational Data Structures</A></H1><P><A NAME="chapfds"> </A><P>In this book we consider a variety of<em>abstract data types</em><A NAME=2526> </A>(ADTs)<A NAME=2564> </A>,including stacks, queues, deques, ordered lists, sorted lists,hash and scatter tables, trees, priority queues, sets, and graphs.In just about every case,we have the option of implementing the ADTusing an array or using a some kind of linked data structure.<P>Because they are the base upon which almost all of the ADTs are built,we call the <em>array</em><A NAME=2529> </A>and the <em>linked list</em><A NAME=2531> </A>the <em>foundational data structures</em><A NAME=2533> </A>.It is important to understand thatwe do not view the array or the linked list as ADTs,but rather as alternatives for the implementation of ADTs.<P>In this chapter we consider arrays first.We review the support for arrays in Python andand present an <tt>Array</tt> class implementationthat provides resizeable arrays with arbitrary subscript ranges.We also discuss multi-dimensional arrays and matrices.Next, we consider a number of linked list implementation alternativesand we discuss in detail the implementationof a singly-linked list class, <tt>LinkedList</tt>.It is important to become familiar withthe <tt>Array</tt> and <tt>LinkedList</tt> classes,as they are used extensively throughout the remainder of the book.<P><BR> <HR><UL> <LI> <A NAME="tex2html2137" HREF="page82.html#SECTION004100000000000000000">Python Lists and Arrays</A><LI> <A NAME="tex2html2138" HREF="page89.html#SECTION004200000000000000000">Multi-Dimensional Arrays</A><LI> <A NAME="tex2html2139" HREF="page97.html#SECTION004300000000000000000">Singly-Linked Lists</A><LI> <A NAME="tex2html2140" HREF="page109.html#SECTION004400000000000000000">Exercises</A><LI> <A NAME="tex2html2141" HREF="page110.html#SECTION004500000000000000000">Projects</A></UL><HR><A NAME="tex2html2134" HREF="page82.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html2132" HREF="book.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html2126" HREF="page80.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html2136" 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 + -
显示快捷键?