Helper function to find floor and ceil of a given key in BST
public int floorCeilBSTHelper ( Node root , int key ) { while ( root != null ) { if ( root . data == key ) { ceil = root . data ; floor = root . data ; return 0 ; } if ( key > root . data ) { floor = root . data ; root = root . right ; } else { ceil = root . data ; root = root . left ; } } return 0 ; }