aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-03-20 07:17:47 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-03-20 07:17:47 +0100
commit28b1a7f79b7d49f3e6476daec708578bb0225215 (patch)
tree7edbac55b58a9eeb4a3e9d89e7ceaa33bd450c08
parentRenamed class named in binarytree.py (diff)
downloadnewspipe-28b1a7f79b7d49f3e6476daec708578bb0225215.tar.gz
newspipe-28b1a7f79b7d49f3e6476daec708578bb0225215.tar.bz2
newspipe-28b1a7f79b7d49f3e6476daec708578bb0225215.zip
Minor changes in testbinarytree.py.
-rw-r--r--source/testbinarytree.py14
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)
bgstack15