Characterization of the alternating group by its non-commuting graph