diff options
-rw-r--r-- | source/testbinarytree.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/testbinarytree.py b/source/testbinarytree.py index 526ddd7f..7694ad4e 100644 --- a/source/testbinarytree.py +++ b/source/testbinarytree.py @@ -22,22 +22,22 @@ print(("{} articles loaded in {} seconds.".format(len(articles), end-begin))) print("Generating the binary tree...") begin = time.time() -BTree = binarytree.CBOrdTree() +tree = binarytree.OrderedBinaryTree() # add the root node (first article of the list) -root = BTree.addNode(articles[0]) +root = tree.addNode(articles[0]) for article in articles[1:]: - BTree.insert(root, article) + tree.insert(root, article) end = time.time() print(("Generation done in {0:2f} seconds.".format(end-begin))) print("Maximum depth of the tree:") -print(BTree.maxDepth(root)) +print(tree.maxDepth(root)) print("Oldest article:") -oldest_article = BTree.minValue(root) +oldest_article = tree.minValue(root) print((oldest_article["article_date"].strftime('%Y-%m-%d %H:%M') + \ " - " + oldest_article["article_title"])) print("Newest article:") -newest_article = BTree.maxValue(root) +newest_article = tree.maxValue(root) print((newest_article["article_date"].strftime('%Y-%m-%d %H:%M') + \ " - " + newest_article["article_title"])) -print(BTree) +print(tree) |