def parent_ball(coord)
      current = root
      d_idx = current.dimension-1
      result = nil
      while(result.nil?)
        if(coord[d_idx] <= current.center[d_idx])
          if current.left.nil?
            result = current
          else
            current = current.left
          end
        else
          if current.right.nil?
            result = current
          else
            current = current.right
          end
        end
        d_idx = current.dimension-1
      end
      return result
    end
def parent_ball(coord)
      current = root
      d_idx = current.dimension-1
      result = nil
      while(result.nil?)
        if(coord[d_idx] <= current.center[d_idx])
          if current.left.nil?
            result = current
          else
            current = current.left
          end
        else
          if current.right.nil?
            result = current
          else
            current = current.right
          end
        end
        d_idx = current.dimension-1
      end
      return result
    end
def parent_ball ( coord ) current = root d_idx = current . dimension - 1 result = nil while ( result . nil? ) if ( coord [ d_idx ] <= current . center [ d_idx ] ) if current . left . nil? result = current else current = current . left end else if current . right . nil? result = current else current = current . right end end d_idx = current . dimension - 1 end return result end
Retrieve the parent to which this coord should belongs to
Retrieve the parent to which this coord should belongs to