⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datastructures.pairheap.html

📁 Data StructuresAnd Algorithm Analysis In Java Source Code
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Sep 27 09:53:39 EDT 1998
-->
<title>
Class DataStructures.PairHeap
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-DataStructures.html">This Package</a>  <a href="DataStructures.MyInteger.html">Previous</a>  <a href="DataStructures.PairNode.html">Next</a>  <a href="Index.html">Index</a>  </pre>
<hr>
<h1>
Class DataStructures.PairHeap
</h1>
<pre>
java.lang.Object
    |
    +----DataStructures.PairHeap
</pre>
<hr>
<dl>
<dt>public class <b>PairHeap</b>
<dt>extends Object</dl>
Implements a pairing heap.Supports a decreaseKey operation.Note that all "matching" is based on the compareTo method.
<p>
<dl>
<dt><b>See Also:</b>
<dd><a href="DataStructures.PairNode.html">PairNode</a></dl>
<hr>
<a name="index"></a><h2>
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
<dt><img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#PairHeap()"><b>PairHeap</b></a>()
<dd>Construct the pairing heap.
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#decreaseKey(DataStructures.PairNode, DataStructures.Comparable)"><b>decreaseKey</b></a>(PairNode, Comparable)
<dd>Change the value of the item stored in the pairing heap.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#deleteMin()"><b>deleteMin</b></a>()
<dd>Remove the smallest item from the priority queue.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#findMin()"><b>findMin</b></a>()
<dd>Find the smallest item in the priority queue.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#insert(DataStructures.Comparable)"><b>insert</b></a>(Comparable)
<dd>Insert into the priority queue, and return a PairNodethat can be used by decreaseKey.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#isEmpty()"><b>isEmpty</b></a>()
<dd>Test if the priority queue is logically empty.
<dt><img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#main(java.lang.String[])"><b>main</b></a>(String[])
<dd>
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#makeEmpty()"><b>makeEmpty</b></a>()
<dd>Make the priority queue logically empty.
</dl>
<a name="constructors"></a><h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="PairHeap"></a><a name="PairHeap"></a><a name="PairHeap()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>PairHeap</b>
<pre>
public PairHeap()</pre>
<dl>
<dd>Construct the pairing heap.
<p>
</dl>
<a name="methods"></a><h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="insert"></a><a name="insert(DataStructures.Comparable)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>insert</b>
<pre>
public <a href="DataStructures.PairNode.html">PairNode</a> insert(<a href="DataStructures.Comparable.html">Comparable</a> x)</pre>
<dl>
<dd>Insert into the priority queue, and return a PairNodethat can be used by decreaseKey.Duplicates are allowed.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the item to insert.
<dt><b>Returns:</b>
<dd>the node containing the newly inserted item.</dl>
</dd>
</dl>
<a name="findMin"></a><a name="findMin()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>findMin</b>
<pre>
public <a href="DataStructures.Comparable.html">Comparable</a> findMin()</pre>
<dl>
<dd>Find the smallest item in the priority queue.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the smallest item, or null if empty.</dl>
</dd>
</dl>
<a name="deleteMin"></a><a name="deleteMin()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>deleteMin</b>
<pre>
public <a href="DataStructures.Comparable.html">Comparable</a> deleteMin()</pre>
<dl>
<dd>Remove the smallest item from the priority queue.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the smallest item, or null if empty.</dl>
</dd>
</dl>
<a name="decreaseKey"></a><a name="decreaseKey(DataStructures.PairNode, DataStructures.Comparable)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>decreaseKey</b>
<pre>
public void decreaseKey(<a href="DataStructures.PairNode.html">PairNode</a> p,                        <a href="DataStructures.Comparable.html">Comparable</a> newVal)</pre>
<dl>
<dd>Change the value of the item stored in the pairing heap.Does nothing if newVal is larger than the currently stored value.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>p - any node returned by addItem.
<dd>newVal - the new value, which must be smallerthan the currently stored value.
</dl>
</dd>
</dl>
<a name="isEmpty"></a><a name="isEmpty()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>isEmpty</b>
<pre>
public boolean isEmpty()</pre>
<dl>
<dd>Test if the priority queue is logically empty.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>true if empty, false otherwise.</dl>
</dd>
</dl>
<a name="makeEmpty"></a><a name="makeEmpty()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>makeEmpty</b>
<pre>
public void makeEmpty()</pre>
<dl>
<dd>Make the priority queue logically empty.
<p>
</dl>
<a name="main"></a><a name="main(java.lang.String[])"><img src="images/green-ball.gif" width=12 height=12 alt=" o ">
</a><b>main</b>
<pre>
public static void main(String[] args)</pre>
<dl>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-DataStructures.html">This Package</a>  <a href="DataStructures.MyInteger.html">Previous</a>  <a href="DataStructures.PairNode.html">Next</a>  <a href="Index.html">Index</a>  </pre>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -