Skip to content

Commit

Permalink
Update binary_trees.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene536 authored and alk committed Apr 16, 2017
1 parent cd8586e commit 86ce69d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions benchmark/binary_trees.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ struct Node {
Node(Node *l2, int i2, Node *r2) : l(l2), r(r2), i(i2) {}
~Node() { delete l; delete r; }
int check() const {
if (l)
return l->check() + i - r->check();
else return i;
if (l) {
return l->check() + i - r->check();
} else {
return i;
}
}
};

Expand Down

0 comments on commit 86ce69d

Please sign in to comment.