What is missing in this logic of finding a path in the tree for a given sum (i.e checking whether there will be a path from roots to leaf nodes with given sum)?
checkSum(struct bin-treenode *root , int sum) :
if(root==null)
return sum as 0
else :
leftover_sum=sum-root_node-->value
//missing
Consider the below left-left rotation pseudo code where the node contains value pointers to left, right child nodes and a height value and Height() function returns height value stored at a particular node. What is missing?
avltree leftrotation(avltreenode z):
avltreenode w =x-left
x-left=w-right
w-right=x
x-height=max(Height(x-left),Height(x-right))+1
w-height=max(missing)+1
return w