I have this Student class
class Student:
def __init__(self, name, id):
self.name = name
self.id = id
I need to sort some objects of from Student class spesifically using either merge/quick sort to sort the id and the expected result is array of Students' names. So in case i have these objects:
s1 = Student("Andy", 4)
s2 = Student("Bob", 3)
s3 = Student("Sophie", 2)
s4 = Student("Tony", 1)
s5 = Student("Jerry", 5)
And the expected result:
result = ["Tony", "Sophie", "Bob", "Andy", "Jerry"]
I'm not sure i need to create Array of object or where i put the Sorting function.
Any thoughts?