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

📄 binarytree.html

📁 学习JAVA的很好的JAVA包和文档包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<DT><B>Postcondition:</B><DD>Returns the root of the tree node n<DT><B>Returns:</B><DD>Root of tree</DL></DD></DL><HR><A NAME="height()"><!-- --></A><H3>height</H3><PRE>public int <B>height</B>()</PRE><DL><DD>Returns height of node in tree.  Height is maximum path length to descendant<DD><DL><DT><B>Postcondition:</B><DD>Returns the height of a node in its tree<DT><B>Returns:</B><DD>The height of the node in the tree</DL></DD></DL><HR><A NAME="depth()"><!-- --></A><H3>depth</H3><PRE>public int <B>depth</B>()</PRE><DL><DD>Compute the depth of a node.  The depth is the path length from node to root<DD><DL><DT><B>Postcondition:</B><DD>Returns the depth of a node in the tree<DT><B>Returns:</B><DD>The path length to root of tree</DL></DD></DL><HR><A NAME="isFull()"><!-- --></A><H3>isFull</H3><PRE>public boolean <B>isFull</B>()</PRE><DL><DD>Returns true if tree is full.  A tree is full if adding a node to tree would necessarily increase its height<DD><DL><DT><B>Postcondition:</B><DD>Returns true iff the tree rooted at node is full<DT><B>Returns:</B><DD>True iff tree is full</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Returns true if tree is empty.<DD><DL><DT><B>Postcondition:</B><DD>Returns true iff the tree rooted at node is empty<DT><B>Returns:</B><DD>True iff tree is empty</DL></DD></DL><HR><A NAME="isComplete()"><!-- --></A><H3>isComplete</H3><PRE>public boolean <B>isComplete</B>()</PRE><DL><DD>Return whether tree is complete.  A complete tree has minimal height and any holes in tree would appear in last level to right.<DD><DL><DT><B>Postcondition:</B><DD>Returns true iff the tree rooted at node is complete<DT><B>Returns:</B><DD>True iff the subtree is complete</DL></DD></DL><HR><A NAME="isBalanced()"><!-- --></A><H3>isBalanced</H3><PRE>public boolean <B>isBalanced</B>()</PRE><DL><DD>Return true iff the tree is height balanced.  A tree is height balanced iff at every node the difference in heights of subtrees is no greater than one<DD><DL><DT><B>Postcondition:</B><DD>Returns true iff the tree rooted at node is balanced<DT><B>Returns:</B><DD>True if tree is height balanced</DL></DD></DL><HR><A NAME="iterator()"><!-- --></A><H3>iterator</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A> <B>iterator</B>()</PRE><DL><DD>Generate an in-order iterator of subtree<DD><DL><DT><B>Postcondition:</B><DD>Returns an in-order iterator of the elements<DT><B>Returns:</B><DD>In-order iterator on subtree rooted at this</DL></DD></DL><HR><A NAME="preorderIterator()"><!-- --></A><H3>preorderIterator</H3><PRE>public <A HREF="../structure/AbstractIterator.html">AbstractIterator</A> <B>preorderIterator</B>()</PRE><DL><DD>Return an iterator to traverse nodes of subtree in-order<DD><DL><DT><B>Postcondition:</B><DD>The elements of the binary tree rooted at node are       traversed in preorder<DT><B>Returns:</B><DD>AbstractIterator to traverse subtree</DL></DD></DL><HR><A NAME="inorderIterator()"><!-- --></A><H3>inorderIterator</H3><PRE>public <A HREF="../structure/AbstractIterator.html">AbstractIterator</A> <B>inorderIterator</B>()</PRE><DL><DD>Return an iterator to traverse the elements of subtree in-order<DD><DL><DT><B>Postcondition:</B><DD>The elements of the binary tree rooted at node node are       traversed in inorder<DT><B>Returns:</B><DD>An in-order iterator over descendants of node</DL></DD></DL><HR><A NAME="postorderIterator()"><!-- --></A><H3>postorderIterator</H3><PRE>public <A HREF="../structure/AbstractIterator.html">AbstractIterator</A> <B>postorderIterator</B>()</PRE><DL><DD>Return an iterator to traverse the elements of subtree in post-order<DD><DL><DT><B>Precondition:</B><DD>None<DT><B>Postcondition:</B><DD>The elements of the binary tree rooted at node node are       traversed in postorder<DT><B>Returns:</B><DD>An iterator that traverses descendants of node in postorder</DL></DD></DL><HR><A NAME="levelorderIterator()"><!-- --></A><H3>levelorderIterator</H3><PRE>public <A HREF="../structure/AbstractIterator.html">AbstractIterator</A> <B>levelorderIterator</B>()</PRE><DL><DD>Method to return a level-order iterator of subtree<DD><DL><DT><B>Precondition:</B><DD>None<DT><B>Postcondition:</B><DD>The elements of the binary tree rooted at node node are       traversed in levelorder<DT><B>Returns:</B><DD>An iterator to traverse subtree in level-order</DL></DD></DL><HR><A NAME="rotateRight()"><!-- --></A><H3>rotateRight</H3><PRE>protected void <B>rotateRight</B>()</PRE><DL><DD>Method to perform a right rotation of tree about this node Node must have a left child.  Relation between left child and node are reversed<DD><DL><DT><B>Precondition:</B><DD>This node has a left subtree<DT><B>Postcondition:</B><DD>Rotates local portion of tree so left child is root</DL></DD></DL><HR><A NAME="rotateLeft()"><!-- --></A><H3>rotateLeft</H3><PRE>protected void <B>rotateLeft</B>()</PRE><DL><DD>Method to perform a left rotation of tree about this node Node must have a right child.  Relation between right child and node are reversed<DD><DL><DT><B>Precondition:</B><DD>This node has a right subtree<DT><B>Postcondition:</B><DD>Rotates local portion of tree so right child is root</DL></DD></DL><HR><A NAME="isLeftChild()"><!-- --></A><H3>isLeftChild</H3><PRE>public boolean <B>isLeftChild</B>()</PRE><DL><DD>Determine if this node is a left child<DD><DL><DT><B>Postcondition:</B><DD>Returns true if this is a left child of parent<DT><B>Returns:</B><DD>True iff this node is a left child of parent</DL></DD></DL><HR><A NAME="isRightChild()"><!-- --></A><H3>isRightChild</H3><PRE>public boolean <B>isRightChild</B>()</PRE><DL><DD>Determine if this node is a right child<DD><DL><DT><B>Postcondition:</B><DD>Returns true if this is a right child of parent<DT><B>Returns:</B><DD>True iff this node is a right child of parent</DL></DD></DL><HR><A NAME="value()"><!-- --></A><H3>value</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>value</B>()</PRE><DL><DD>Returns value associated with this node<DD><DL><DT><B>Postcondition:</B><DD>Returns value associated with this node<DT><B>Returns:</B><DD>The node's value</DL></DD></DL><HR><A NAME="setValue(java.lang.Object)"><!-- --></A><H3>setValue</H3><PRE>public void <B>setValue</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;value)</PRE><DL><DD>Set's value associated with this node<DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - The new value of this node<DT><B>Postcondition:</B><DD>Sets the value associated with this node</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>return sum of hashcodes of the contained values</DL></DD></DL><HR><A NAME="treeString()"><!-- --></A><H3>treeString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>treeString</B>()</PRE><DL><DD>Returns a string representing the tree rooted at this node. <font color="#FF0000">WARNING</font> this can be a very long string.<DD><DL><DT><B>Returns:</B><DD>A string representing the tree rooted at this node.</DL></DD></DL><HR><A NAME="getHand()"><!-- --></A><H3>getHand</H3><PRE>private <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>getHand</B>()</PRE><DL><DD>Support method for <A HREF="../structure/BinaryTree.html#toString()"><CODE>toString()</CODE></A>. Returns R if this is node  is a right child, L if this node is a left child and Root if this node is the root.<DD><DL><DT><B>Returns:</B><DD>R if this is node  is a right child, L if this node is a left child and Root if this node is the root.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a representation the subtree rooted at this node<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>Returns string representation<DT><B>Returns:</B><DD>String representing this subtree</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href=../copyright.html target=_top>&copy; 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../structure/BinarySearchTree.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../structure/BitSet.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="BinaryTree.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>

⌨️ 快捷键说明

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