Driver program to test the above functions
public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; BinaryTree . root = new Node ( 8 ) ; BinaryTree . root . left = new Node ( 4 ) ; BinaryTree . root . right = new Node ( 12 ) ; BinaryTree . root . left . left = new Node ( 2 ) ; BinaryTree . root . left . right = new Node ( 6 ) ; BinaryTree . root . right . left = new Node ( 10 ) ; BinaryTree . root . right . right = new Node ( 14 ) ; for ( int i = 0 ; i < 16 ; i ++ ) { Console . WriteLine ( i + " ▁ " + tree . Ceil ( root , i ) ) ; } } }