Since there are so many sorting algorithms so I will only talk about some of them.
Bubble sort. In bubble sort, assume there are n items will be sorted and there is a key pointing to the first item, which also can say that bubble sort starts from the first item, then the first item will compare to the first item behind it which is second item to see which one is bigger. If the value of front item is greater than the latter item, swap them. Then the key will move and point to the second item and compare the value of first item behind it to see whether first one is greater. If so, swap them...Bubble sort will keep repeating these steps until the key points at the last item. Then the item that has the maximum value will be bubbled up and putted in the end of all the items. (see picture below, the picture is from the website)
That is the first pass and only the largest value is in place. There are still n-1items left and waiting to be sorted. Then the key will point to the first item again and repeating the steps above until all the items are in the right place. I think Bubble sort is not that efficient because there are so many exchange and compare steps.
Selection sort. In selection sort, first find the largest item and put it at the end of all the items then find the largest the item in the rest of the items and put in before the largest item which is just sorted.(see the picture below, the picture is from the website)
And the selection sort will keep doing these until all the items is in the right place. Compare to the Bubble sort, I think selection sort greatly reduce the running time and improve the efficiency since it requires less number of exchanges.
Merge sort. In merge sort, the concept of divide and conquer strategy is really important. In my comprehension, merge sort will split the list in half and each of the half is already sorted. Then create the new empty list and set two keys to point at the first item of both two half lists. Compare the items pointed by key in both half lists and put the smaller item in front of the bigger one in the new empty list. Then the key will move to the second item in both half lists and do the comparison again until the key is out of one of the half list. Then put the rest of the items from other half list into the end of the created list. How to find those two half sorted list is also very essential in merge sort. Basically, we have to do the recursion, merge sort will recursively split the list into half until there are only two or one item left, then sort them by definition (called the base case). Then do the way mentioned above to combine two half list to one single list until there is only one single list left. This step also requires recursion.
Making a Comparison Of different Sorting algorithms. This week's lab, we are asked to compare the running time of different sorting algorithms of different number of items. Basically, the build-in function is the quickest way to sort and when the number of items become larger and larger, bubble sort will have the largest running time which seems like it has the lowest efficiency.
Overall, sorting algorithms are not as easy as I thought because it needs us totally understand the concept and the way each sorting algorithm has. For me, merge sort and quick sort are the most difficult sorting algorithms to understand and they take me quit a bit of time to figure out how they work and even if there are prof's code examples help me , it is still really hard for me to translate these two algorithms into python codes. And I think I still have some question about them and I will keep practicing and figuring them out in the future.