Science, asked by navedansari6543, 1 year ago

How to find the max weight in the binary tree?

Answers

Answered by Jocrasher12
0

You can find maximum weight by traversing right pointers until we reach rightmost node. But in Binary Tree, we must visit every node to figure out maximum. So the idea is to traverse the given tree and for every node return maximum of 3 values.

1) Node’s data.

2) Maximum in node’s left subtree.

3) Maximum in node’s right subtree.

Answered by rockyak4745
0
In Binary Search Tree, we can find maximum by traversing right pointers until we reach rightmost node. But in Binary Tree, we .
Similar questions