completato binary tree e implementato euler tour astratto + una sua implementazione per computazione aritmetica

This commit is contained in:
2014-04-27 13:38:06 +02:00
parent cd1a246d4f
commit 4f68dd31d1
11 changed files with 208 additions and 6 deletions

View 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; }
}