Characterization of knot complements in the n-sphere