Sum Of Nodes
Given a binary tree, find and return the sum of all nodes.
Input format :
Elements in level order form (separated by space). If any node does not have left or right child, take -1 in its place.
Given a binary tree, find and return the sum of all nodes.
Input format :
Elements in level order form (separated by space). If any node does not have left or right child, take -1 in its place.
5 6 10 2 3 -1 -1 -1 -1 -1 9 -1 -1
35
Comments
Post a Comment
Please give us your valuable feedback