summaryrefslogtreecommitdiff
path: root/tree/src/cTree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tree/src/cTree.cpp')
-rw-r--r--tree/src/cTree.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tree/src/cTree.cpp b/tree/src/cTree.cpp
index f4fcf9a..943819c 100644
--- a/tree/src/cTree.cpp
+++ b/tree/src/cTree.cpp
@@ -104,6 +104,9 @@ unsigned int cTree::depth()
unsigned int cTree::gradeOfUnbalance()
{
+ if(root->getSubtreeSize() == 0)
+ return 0;
+
double minDepth = log2(size());
unsigned int iDepth = depth();