Abstract:The courses selection is the matching problem, and an improved Gale-Shapley algorithm is put forward. According to the students’preference to a course, the course is taken as unit to set division of students, and the random seed is issued to the students with the same preference, then the students are sorted and admitted, the admission students are signed with the hash mark and the relative storage space is released, thus the two-way selection match between the students and the curriculum is completed. Algorithm analysis results show that the optimal algorithm reduces the space and time complexity and realizes the maximum satisfied match between the students and the curriculum.