Aida Behroozian
asked on
sum of leaves in Binary Tree
we have a binary tree in scheme like this : (node (leaf 1) (node (leaf 2) (leaf 3)))
we want to calculate sum of number in leaves
(display (sum '(node (leaf 1) (node (leaf 2) (leaf 3)))))
result => 6
we want to calculate sum of number in leaves
(display (sum '(node (leaf 1) (node (leaf 2) (leaf 3)))))
result => 6
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.