Returns destance of the closes leaf to a given key k The array ancestors us used to keep track of ancestors of current node and ' index ' is used to keep track of current index in 'ancestors[i]
def findClosestUtil ( root , k , ancestors , index ) : NEW_LINE