returns true if all the nodes in the list are leaves nodes
bool allLeaf(List<Node<E>> nodes) { return nodes .every((element) => getSubNodes(element).isEmpty || element.hideNodes); }