fixed linked tree

This commit is contained in:
2014-04-24 02:07:23 +02:00
parent 3607c918db
commit 3fe3c635d8
2 changed files with 84 additions and 9 deletions

View File

@@ -0,0 +1,46 @@
package com.xgiovio;
import tree.LinkedTree;
/**
* Created with MONSTER.
* User: xgiovio
* Date: 23/04/2014
* Time: 21:46
*/
public class LinkedTreeTest {
public static void main(String[] args) {
LinkedTree<Integer> a = new LinkedTree<Integer>();
System.out.println(a.size());
System.out.println(a.isEmpty());
System.out.println(a);
a.addRoot(10);
System.out.println(a.size());
System.out.println(a.isEmpty());
System.out.println(a);
System.out.println(a.height());
a.addChild(15,a.root());
a.addChild(30,a.root());
System.out.println(a.size());
System.out.println(a.isEmpty());
System.out.println(a);
a.addChild(100,a.children(a.root()).iterator().next());
System.out.println(a.size());
System.out.println(a.isEmpty());
System.out.println(a);
System.out.println(a.height());
}
}