Recursive function to calculate the path Length having maximum number of bends . The following are parameters for this function . node - . pointer to the current node Dir - . determines whether the current node is left or right child of it 's parent node bends -. number of bends so far in the current path. maxBends -. maximum number of bends in a path from root to leaf soFar -. Length of the current path so far traversed Len -. Length of the path having maximum number of bends
def findMaxBendsUtil ( node , Dir , bends , maxBends , soFar , Len ) : NEW_LINE