construct a tree
Node root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . right = newNode ( 4 ) ; root . right . left = newNode ( 5 ) ; root . right . right = newNode ( 6 ) ; root . right . left . right = newNode ( 7 ) ; root . right . right . right = newNode ( 8 ) ; root . right . left . right . left = newNode ( 9 ) ; root . right . right . right . right = newNode ( 10 ) ; Node result = getDeepestRightLeafNode ( root ) ; if ( result != null ) Console . WriteLine ( " Deepest ▁ Right ▁ Leaf ▁ Node ▁ : : ▁ " + result . data ) ; else Console . WriteLine ( " No ▁ result , ▁ right ▁ leaf ▁ not ▁ found STRNEWLINE " ) ; } }