Hi, I am creating a program in which students sign up for an exam, which is held in several cities across the country. While signing students provide a list of three cities where they would like to take the exam in the order of their preference. Thus, the student can say that his first preference for the examination center is New York, then Chicago, then Boston.
Now, bearing in mind that since exam centers have limited capacity, they cannot accommodate each student of their first choice. However, we will try to provide as many students as possible, either their first or second choice of centers, and, as far as possible, to avoid students having a third center of choice for the student
Now any ideas for the sorting algorithm that would facilitate this process were more effective. An easy way to do this would be to first go through the list of students' first choice in order to select as many as possible, and then list the list of second options and highlight. However, this can lead to students who are first on the list to receive their first center, and last students to receive their third choice or worse none of their choices. All that could make it more efficient
source share