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

📄 twowaybinarynodeuos.java

📁 国外的数据结构与算法分析用书
💻 JAVA
字号:
/* TwoWayBinaryNodeUos.java
 * ---------------------------------------------
 * Copyright (c) 2001 University of Saskatchewan
 * All Rights Reserved
 * --------------------------------------------- */

package dslib.tree;

/**	A node containing an item, and references to left and 
	right nodes, as well as to the parent node. */
public class TwoWayBinaryNodeUos extends BinaryNodeUos
{
	/**	Pointer to the parent node. <br> */
	protected TwoWayBinaryNodeUos parentNode;

	/**	Construct a new node with item x. <br> 
		Analysis: Time = O(1) 
		@param x item placed in the new node */	
	public TwoWayBinaryNodeUos(Object x)
	{
		super(x);
	}

	/**	Return the parent node. <br> 
		Analysis: Time = O(1) */
	public TwoWayBinaryNodeUos parentNode()
	{
		return parentNode;
	}
	
	/**	Set parent node to newNode. <br> 
		Analysis: Time = O(1) 
		@param newNode node to be set as the parent of the current node */	
	public void setParentNode(BinaryNodeUos newNode)
	{
		parentNode = (TwoWayBinaryNodeUos)newNode;
	}

} 

⌨️ 快捷键说明

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