import DAT.*; public class BintreeLinked { TreeCell beforeRoot; // constructor public BintreeLinked () {beforeRoot = new TreeCell(null, null, null);} // checkers public boolean isEmpty() {return beforeRoot.children[0] == null;} public boolean isExternal(TreeWindow w) { return w.parentnode.children[w.childnum] == null; } public boolean isLeaf(TreeWindow w) { return !isExternal(w) && w.parentnode.children[w.childnum].children[0] == null && w.parentnode.children[w.childnum].children[1] == null; } // manipulators public void initialise(TreeWindow w) { w.parentnode = beforeRoot; w.childnum = 0; } }