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

📄 datastructures.splaytree.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:41 EDT 1998
-->
<title>
Class DataStructures.SplayTree
</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.Sort.html">Previous</a>  <a href="DataStructures.StackAr.html">Next</a>  <a href="Index.html">Index</a>  </pre>
<hr>
<h1>
Class DataStructures.SplayTree
</h1>
<pre>
java.lang.Object
    |
    +----DataStructures.SplayTree
</pre>
<hr>
<dl>
<dt>public class <b>SplayTree</b>
<dt>extends Object</dl>
Implements a top-down splay tree.Note that all "matching" is based on the compareTo method.
<p>
<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="#SplayTree()"><b>SplayTree</b></a>()
<dd>Construct the tree.
</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="#find(DataStructures.Comparable)"><b>find</b></a>(Comparable)
<dd>Find an item in the tree.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#findMax()"><b>findMax</b></a>()
<dd>Find the largest item in the tree.
<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 tree.
<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 tree.
<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 tree 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 tree logically empty.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#printTree()"><b>printTree</b></a>()
<dd>Print the tree contents in sorted order.
<dt><img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#remove(DataStructures.Comparable)"><b>remove</b></a>(Comparable)
<dd>Remove from the tree.
</dl>
<a name="constructors"></a><h2>
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="SplayTree"></a><a name="SplayTree"></a><a name="SplayTree()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o ">
</a><b>SplayTree</b>
<pre>
public SplayTree()</pre>
<dl>
<dd>Construct the tree.
<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 void insert(<a href="DataStructures.Comparable.html">Comparable</a> x)</pre>
<dl>
<dd>Insert into the tree.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the item to insert.
</dl>
</dd>
</dl>
<a name="remove"></a><a name="remove(DataStructures.Comparable)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>remove</b>
<pre>
public void remove(<a href="DataStructures.Comparable.html">Comparable</a> x)</pre>
<dl>
<dd>Remove from the tree.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the item to remove.
</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 tree.Not the most efficient implementation (uses two passes), but has correctamortized behavior.A good alternative is to first call Find with parametersmaller than any item in the tree, then call findMin.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the smallest item or null if empty.</dl>
</dd>
</dl>
<a name="findMax"></a><a name="findMax()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>findMax</b>
<pre>
public <a href="DataStructures.Comparable.html">Comparable</a> findMax()</pre>
<dl>
<dd>Find the largest item in the tree.Not the most efficient implementation (uses two passes), but has correctamortized behavior.A good alternative is to first call Find with parameterlarger than any item in the tree, then call findMax.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>the largest item or null if empty.</dl>
</dd>
</dl>
<a name="find"></a><a name="find(DataStructures.Comparable)"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>find</b>
<pre>
public <a href="DataStructures.Comparable.html">Comparable</a> find(<a href="DataStructures.Comparable.html">Comparable</a> x)</pre>
<dl>
<dd>Find an item in the tree.
<p>
<dd><dl>
<dt><b>Parameters:</b>
<dd>x - the item to search for.
<dt><b>Returns:</b>
<dd>the matching item or null if not found.</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 tree logically empty.
<p>
</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 tree is logically empty.
<p>
<dd><dl>
<dt><b>Returns:</b>
<dd>true if empty, false otherwise.</dl>
</dd>
</dl>
<a name="printTree"></a><a name="printTree()"><img src="images/red-ball.gif" width=12 height=12 alt=" o ">
</a><b>printTree</b>
<pre>
public void printTree()</pre>
<dl>
<dd>Print the tree contents in sorted order.
<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.Sort.html">Previous</a>  <a href="DataStructures.StackAr.html">Next</a>  <a href="Index.html">Index</a>  </pre>
</body>
</html>

⌨️ 快捷键说明

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