Dsa
Sorting
Medium
Course Registration System
A university is implementing a new course registration system that requires sorting courses based on their enrollment numbers. If two courses have the same enrollment number, they should be sorted alphabetically by course title. Your program should read a list of course titles and their enrollment numbers, and print the sorted list of course titles.
Input:
The first line contains an integer N (1 <= N <= 1000), the number of courses.
The next N lines each contain a course title (a string) followed by its enrollment number (an integer).
Output:
Print the sorted list of course titles, one per line.
Example:
Input:
3
Math 100
Biology 150
Chemistry 100
Output:
Biology
Chemistry
Math
Key concepts
sortingpairspriority
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now