From 28b1a7f79b7d49f3e6476daec708578bb0225215 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 20 Mar 2013 07:17:47 +0100 Subject: Minor changes in testbinarytree.py. --- source/testbinarytree.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source') 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) -- cgit