public void preorder(Wezel root) { Console.WriteLine(root.wartosc); if (root.lewe != null) { preorder(root.lewe); } if (root.prawe != null) { preorder(root.prawe); } } public void inorder(Wezel root) { if (root.lewe != null) { inorder(root.lewe); } Console.WriteLine(root.wartosc); if (root.prawe != null) { inorder(root.prawe); } } public void postorder(Wezel root) { if (root.lewe != null) { postorder(root.lewe); } if (root.prawe != null) { postorder(root.prawe); } Console.WriteLine(root.wartosc); } public void test() { if (length < 1) { root = null; Console.WriteLine("Brak drzewa"); } else { preorder(root); } } public void test2() { if (length < 1) { root = null; Console.WriteLine("Brak drzewa"); } else { inorder(root); } } public void test3() { if (length < 1) { root = null; Console.WriteLine("Brak drzewa"); } else { postorder(root); } }