Helper function to find floor and ceil of a given key in BST
def floorCeilBSTHelper ( root , key ) : NEW_LINE INDENT global floor , ceil NEW_LINE while ( root ) : NEW_LINE INDENT if ( root . data == key ) : NEW_LINE INDENT ceil = root . data NEW_LINE floor = root . data NEW_LINE return NEW_LINE DEDENT if ( key > root . data ) : NEW_LINE INDENT floor = root . data NEW_LINE root = root . right NEW_LINE DEDENT else : NEW_LINE INDENT ceil = root . data NEW_LINE root = root . left NEW_LINE DEDENT DEDENT DEDENT