📄 binarytreenode.java
字号:
package App;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 * @version 2.2(2005.7.6)在基础架构中添加了二叉树类,把树和二叉树两种结构分开来做了 */public class BinaryTreeNode{ // datastructures包内可见的数据成员 protected Object element; protected BinaryTreeNode leftChild; // 对左子树的引用 protected BinaryTreeNode rightChild; // 对右子树的引用 // 三个重载的构造方法 public BinaryTreeNode() {} public BinaryTreeNode(Object theElement) {element = theElement;} public BinaryTreeNode(Object theElement, BinaryTreeNode theleftChild, BinaryTreeNode therightChild) { element = theElement; leftChild = theleftChild; rightChild = therightChild; } // 访问性方法 public BinaryTreeNode getLeftChild() {return leftChild;} public BinaryTreeNode getRightChild() {return rightChild;} public Object getElement() {return element;} // 针对数据成员的变异性方法 public void setLeftChild(BinaryTreeNode theLeftChild) {leftChild = theLeftChild;} public void setRightChild(BinaryTreeNode theRightChild) {rightChild = theRightChild;} public void setElement(Object theElement) {element = theElement;} // 输出数据元素方法 public String toString() {return element.toString();}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -