Today in class we learned about selection sort and quick sort using a demonstration involving different sized cups. I was pretty familiar with selection sort from CSC148 and high school but quick sort was a very clever way of sorting a list using recursion.
Basically, in quick sort you assign a random (in our case: the first) value of our list/sublist to be a pivot. All of the values greater than the pivot are put into a sublist on the right of the pivot and the values on the leftare put into a sublist to the left of the pivot. This is repeated recursively on the left sublist and the right sublist untill we have a fully sorted list
Assignment two is due tomorrow at midnight, due to other class work I've only been able to take a look at it today and to be honest I have no idea what the heck is going on. Hopefully, reading over the assignment further will make it more clear.
In other news, I got to visit my family in Mississauga this weekend, my Grandfather came from back home. It was nice to see them again after a couple of weeks of no contact, but their nagging remind me just why I moved out.
-Steve
Don't worry the assignment is easier than the last one.
ReplyDeleteIf their nagging bothered you, just wait till you get a wife!