diff options
| -rw-r--r-- | challenge-125/abigail/perl/ch-2.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-125/abigail/perl/ch-2.pl b/challenge-125/abigail/perl/ch-2.pl index 29d0c71c02..45806530f7 100644 --- a/challenge-125/abigail/perl/ch-2.pl +++ b/challenge-125/abigail/perl/ch-2.pl @@ -65,12 +65,12 @@ package Tree { # # Depth of a tree is 1 + max (depth left child, depth right child) # Diameter of a tree is max (diameter left child, - # diameter right child, 1 + depth left child + depth right child). + # diameter right child, depth left child + depth right child). # return (0, 0) unless $self; # Leaves have no depth nor diameter. my ($ldp, $ldm) = $self -> left -> _diameter; my ($rdp, $rdm) = $self -> right -> _diameter; - (max ($ldp, $rdp), max ($ldm, $rdm, 1 + $ldp + $rdp)) + (max ($ldp, $rdp), max ($ldm, $rdm, $ldp + $rdp)) } } |
