page484.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 36 行
HTML
36 行
<HTML><HEAD><TITLE>Straight Insertion Sort</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="tex2html6743" HREF="page485.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6741" HREF="page483.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6735" HREF="page483.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6745" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION0015310000000000000000">Straight Insertion Sort</A></H2><A NAME="secsortinginsertion"> </A><P>The key step of any insertion sorting algorithminvolves the insertion of an item into a sorted sequence.There are two aspects to an insertion--finding the correct position in the sequenceat which to insert the new element andmoving all the elements over to make room for the new one.<P>This section presents the<em>straight insertion sorting</em><A NAME=35070> </A><A NAME=35071> </A>algorithm.Straight insertion sorting uses a <em>linear search</em>to locate the position at which the next element is to be inserted.<P><BR> <HR><UL> <LI> <A NAME="tex2html6746" HREF="page485.html#SECTION0015311000000000000000">Implementation</A></UL><HR><A NAME="tex2html6743" HREF="page485.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6741" HREF="page483.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6735" HREF="page483.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6745" 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 + -
显示快捷键?