<jupyter_start><jupyter_text>Return the node with largest number:<jupyter_code>class BinaryTreeNode:
    def __init__(self, data):
        self.data = data
        self.left = None
        self.right = None
           
def treeInput():
        
    rootData = int(input())
    if rootData == -1:
        return None
    
    root = BinaryTreeNode(rootData)
    root.left = treeInput()
    root.right = treeInput()

    return root

def printTreeDetailed(root):
    if root == None:
        return
    print(root.data, end = ":")
    
    if root.left is not None:
        print("L", root.left.data, end = ",")
        
    if root.right is not None:
        print("R", root.right.data, end = " ")
        
    print()
    printTreeDetailed(root.left)
    printTreeDetailed(root.right)
    
def findLargest(root):
    if root == None:
        return -1             # Ideally return -infinity 
    
    leftLargest = findLargest(root.left)
    rightLargest = findLargest(root.right)
    
    m = max(root.data, leftLargest, rightLargest)     # Max functions works for 3 numbers as well
    
    return m

root = treeInput()
print(findLargest(root))<jupyter_output>8
3
10
1
6
-1
14
-1
-1
4
7
13
-1
-1
-1
-1
-1
-1
-1
14
{'fraction_non_alphanumeric': 0.1094650205761317, 'fraction_numerical': 0.022222222222222223, 'mean_word_length': 2.1020408163265305, 'pattern_counts': {'":': 1, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '499334', 'license': 'Unlicense', 'n_tokens_mistral': 435, 'n_tokens_neox': 423, 'n_words': 110, 'path': '13 Binary Trees - 1/13.07 Node with Largest Data.ipynb', 'repo_name': 'suhassuhas/Coding-Ninjas---Data-Structures-and-Algorithms-in-Python', 'size': '1215'}