I was given the following tree:

And then we were told to use the last-child / previous-sibling method to change the implementation of these three. This led to the following:

Now I am working on a Java implementation to perform various functions on this tree. We have a Tree interface and a TreeNode interface. Both of them have many functions that we must fill.
Nodes are created as follows:
MyTreeNode a = new MyTreeNode ("a");
The tree is created (using root) as follows:
MyTree tree = new MyTree (a);
And finally, the nodes are given sibling children as such:
e.setChild(j); e.setSibling(d);
I already wrote methods for setChild, setSibling, getNextSibling, getFirstChild and getChildren. For example, this is the code for getChildren:
public List getChildren () { List <MyTreeNode> children = new ArrayList <MyTreeNode> (); MyTreeNode x = this.child; children.add(x); while (x != null && x.sibling != null) { x = x.sibling; children.add(x); } return children; }
Now I completely lost information on how to write methods for height, depth, size of the subtree node, getPreOrder, getPostOrder and tree size.
Since the tree is now in this other view, I'm not sure how to write recursive methods to check the height or depth of a node. Usually, as I understand it, you would recursively check the left / right subtrees .. but now they are gone (as far as I can see). The only way I could do this is to loop through each node with many if and while statements, but this is not the best way to do this.
How can I write these methods recursively using this tree implementation?
Also, I'm not sure how to get detailed information about the whole tree, since the nodes are not stored together. They are implemented as I showed above, so I'm not sure how to collect data about all nodes collectively.
How can I create methods like tree size, isEmpty or makeEmpty, for all nodes as a whole tree?
Sorry for the overly detailed explanation.