Driver program
NewRoot = null ; root = new Node ( 2 ) ; root . left = new Node ( 7 ) ; root . right = new Node ( 5 ) ; root . left . right = new Node ( 6 ) ; root . left . right . left = new Node ( 1 ) ; root . left . right . right = new Node ( 11 ) ; root . right . right = new Node ( 9 ) ; root . right . right . left = new Node ( 4 ) ; document . write ( " " ) ; printInorder ( root ) ; NewRoot = RemoveHalfNodes ( root ) ; document . write ( " " ) ; printInorder ( NewRoot ) ; script