So, what happened?
I don't know if it was because I relied too much on the IDE while studying, or if it was because I didn't enter with confidence- but something that morning made me feel pretty crappy about myself. It was a constant struggle to decide if I should keep the code I wrote and risk a 0 if it is completely wrong or if I should play it safe and just leave it blank for the small mark...
Oh well, better start cramming for the final now to keep that mark up.
I'll now continue with my understanding of each sorting technique.
The selection sort looks at each element in the list, finds the smallest one and inserts in at index 0. Bubble sort looks at adjacent elements and swaps when necessary. Insertion sort compares the element at index 0 with the rest of the list and inserts it before the element larger than itself. This is all just review from 108.
Now it gets interesting.
Quick sort uses a pivot. This pivot, which can be any element in the list, bases where the list will be reordered. The element that is smaller than the pivot is placed before the pivot, while the element that is larger than the pivot is placed after it. Recursively, the pivot will be in its final place.
Merge sort continuously halves the list (by the magic of recursion), sorts these halves and merges the final divided elements together. This algorithm maintains the same efficiency for its worst, average and best case. Despite both this and quick sort maintaining the same complexity of O(n logn), merge sort actually runs better during its worst case, since quick sort then has a complexity of O(n²).
Efficiency basically means the run-time of an algorithm. Though, I didn't really get it until I experienced it. By this, I mean that the lab was super helpful in illustrating the differences in runtimes for each type of sort. During this lab, I manually inputed runtimes and graphs of each sort. Although I knew already, bubble sort and selection sort demonstrated, by far, the lowest efficiency in their worst case. Python's builtin sort, timsort, was fastest.. This made me look up the efficiencies of other python algorithms, and gave me the euphoric realization that builtins are almost always more efficient than any substitute I'd try to write. This makes life as a coder so much easier. And lazier.
I think I'm done.
Also, I want to say until next time, but this is going to be my last slog, so I shan't.
Good luck to all on finals!