Driver code to test above methods
public static void main ( String [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; System . out . println ( " Density ▁ of ▁ given ▁ Binary ▁ Tree ▁ is ▁ : ▁ " + tree . density ( tree . root ) ) ; } }