Let us construct the following Tree 50 / \ 10 60 / \ / \ 5 20 70 70 / \ / \ 65 80 65 80
root = newNode ( 50 ) NEW_LINE root . left = newNode ( 10 ) NEW_LINE root . right = newNode ( 60 ) NEW_LINE root . left . left = newNode ( 5 ) NEW_LINE root . left . right = newNode ( 20 ) NEW_LINE root . right . left = newNode ( 70 ) NEW_LINE root . right . left . left = newNode ( 65 ) NEW_LINE root . right . left . right = newNode ( 80 ) NEW_LINE root . right . right = newNode ( 70 ) NEW_LINE root . right . right . left = newNode ( 65 ) NEW_LINE root . right . right . right = newNode ( 80 ) NEW_LINE maxNode = [ None ] NEW_LINE maxSize = largestSubtree ( root , maxNode ) NEW_LINE print ( " Largest ▁ Subtree ▁ is ▁ rooted ▁ at ▁ node ▁ " , maxNode [ 0 ] . data ) NEW_LINE print ( " and ▁ its ▁ size ▁ is ▁ " , maxSize ) NEW_LINE