page353.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 38 行
HTML
38 行
<HTML><HEAD><TITLE>Binary Heaps</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="tex2html5256" HREF="page354.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html5254" HREF="page351.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html5248" HREF="page352.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html5258" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION0011200000000000000000">Binary Heaps</A></H1><A NAME="secpqueuesbinheaps"> </A><P>A binary heap is a heap-ordered binary treewhich has a very special shape called a <em>complete tree</em>.As a result of its special shape,a binary heap can be implemented using an array as theunderlying foundational data structure.Array subscript calculations are used to find the parentand the children of a given node in the tree.And since an array is used,the storage overhead associated with the subtree instance attributes contained in the nodesof the trees is eliminated.<P><BR> <HR><UL> <LI> <A NAME="tex2html5259" HREF="page354.html#SECTION0011210000000000000000">Complete Trees</A><LI> <A NAME="tex2html5260" HREF="page356.html#SECTION0011220000000000000000">Implementation</A><LI> <A NAME="tex2html5261" HREF="page359.html#SECTION0011230000000000000000">Putting Items into a Binary Heap</A><LI> <A NAME="tex2html5262" HREF="page360.html#SECTION0011240000000000000000">Removing Items from a Binary Heap</A></UL><HR><A NAME="tex2html5256" HREF="page354.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html5254" HREF="page351.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html5248" HREF="page352.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html5258" 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 + -
显示快捷键?