completato binary tree e implementato euler tour astratto + una sua implementazione per computazione aritmetica
This commit is contained in:
35
tree/binarytree/BTNode.java
Normal file
35
tree/binarytree/BTNode.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package tree.binarytree;
|
||||
|
||||
public class BTNode<E> implements BTPosition<E> {
|
||||
|
||||
private E element = null;
|
||||
private BTPosition<E> left = null;
|
||||
private BTPosition<E> right = null;
|
||||
private BTPosition<E> parent = null;
|
||||
|
||||
public BTNode() { }
|
||||
|
||||
|
||||
public BTNode(E element, BTPosition<E> parent, BTPosition<E> left, BTPosition<E> right) {
|
||||
setElement(element);
|
||||
setParent(parent);
|
||||
setLeft(left);
|
||||
setRight(right);
|
||||
}
|
||||
|
||||
public E element() { return element; }
|
||||
|
||||
public void setElement(E o) { element=o; }
|
||||
|
||||
public BTPosition<E> getLeft() { return left; }
|
||||
|
||||
public void setLeft(BTPosition<E> v) { left=v; }
|
||||
|
||||
public BTPosition<E> getRight() { return right; }
|
||||
|
||||
public void setRight(BTPosition<E> v) { right=v; }
|
||||
|
||||
public BTPosition<E> getParent() { return parent; }
|
||||
|
||||
public void setParent(BTPosition<E> v) { parent=v; }
|
||||
}
|
||||
Reference in New Issue
Block a user