ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Sir ye acha Kia aapne, trees beech mein pending reh gya tha, ab poora ho jaega,thank you
cool is brri miss mt krna lekin
Thank you sir!
You are welcome!
thanku sir
correct code in c++int find(Node* root,int &ans) { if(!root) { return 0; } int l=find(root->left,ans); int r=find(root->right,ans); ans=ans+abs(l-r); return l+r+root->data; } int tiltTree(Node *root) { int ans=0; find(root,ans); return ans; }
For better insights, visit nados.pepcoding.com, post your doubts, community will help you out there.
Sir ye acha Kia aapne, trees beech mein pending reh gya tha, ab poora ho jaega,thank you
cool is brri miss mt krna lekin
Thank you sir!
You are welcome!
thanku sir
correct code in c++
int find(Node* root,int &ans)
{
if(!root)
{
return 0;
}
int l=find(root->left,ans);
int r=find(root->right,ans);
ans=ans+abs(l-r);
return l+r+root->data;
}
int tiltTree(Node *root)
{
int ans=0;
find(root,ans);
return ans;
}
For better insights, visit nados.pepcoding.com, post your doubts, community will help you out there.