page480.html

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

HTML
41
字号
<HTML><HEAD><TITLE>Sorting and Sorters</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="tex2html6696" HREF="page481.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6694" HREF="page478.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6688" HREF="page479.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html6698" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION0015200000000000000000">Sorting and Sorters</A></H1><A NAME="secsortingsorters">&#160;</A><P>The traditional way to implement a sorting algorithmis to write a method that sorts an array of data.This chapter presents an alternate, object-oriented approachthat is based on the notion of an<em>abstract sorter</em><A NAME=34370>&#160;</A><A NAME=34371>&#160;</A>.<P>Think of a sorter as an abstract machine,the sole purpose of which is to sort arrays of data.A machine is an object.Therefore, it makes sense thatwe represent it as an instance of some class.The machine sorts data.Therefore, the class will have a method,say <tt>sort</tt>,which sorts an array of data.<P><BR> <HR><UL> <LI> <A NAME="tex2html6699" HREF="page481.html#SECTION0015201000000000000000">Abstract Sorters</A><LI> <A NAME="tex2html6700" HREF="page482.html#SECTION0015202000000000000000">Sorter Class Hierarchy</A></UL><HR><A NAME="tex2html6696" HREF="page481.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6694" HREF="page478.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6688" HREF="page479.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html6698" 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 + -
显示快捷键?