@@ -0,0 +1,532 @@
+package com.edu.node;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class IteratorNode %7B%0A%0A%0A%09public List%3CNode%3E iterator(Node root) %7B%0A%09%09if (root == null)%0A%09%09%09return null;%0A%09%09List%3CNode%3E list = new ArrayList%3CNode%3E();%0A%09%09for (Node node : root.getChildrens()) %7B%0A%09%09%09list.addAll(iterator(node));%0A%09%09%7D%0A%09%09return list;%0A%09%7D%0A%09%0A%09public static class Node%7B%0A%09%09List%3CNode%3E childrens;%0A%0A%09%09public List%3CNode%3E getChildrens() %7B%0A%09%09%09return childrens;%0A%09%09%7D%0A%0A%09%09public void setChildrens(List%3CNode%3E childrens) %7B%0A%09%09%09this.childrens = childrens;%0A%09%09%7D%0A%09%09%0A%09%7D%0A%7D%0A

add node