1/8/15
Today was a terribly lazy day, but I moved on a bit to merge sort. So far, I learned about Selection Sort, Insertion Sort, and Merge Sort.Â
Selection sort is a very basic algorithm for sorting: the way selection sort works is that you would go through the entire array to put it into the first slot. Then, you would find the next smallest number and the put it into the second slot. You repeat finding the next smallest card each time and swapping it into the correct position until the array is sorted.Â
Insertion sort works a bit differently: Essentially, you would start by comparing the second card (in the 1 index) with the first card (in the 0 index). If the second card is smaller, you switch places. You then proceed to go to the next card and compare it with all the cards previous to it and then insert it into the right index. You continue taking the card at the end of the sorted array and then comparing it to the cards before it until the whole array is sorted.Â
Merge sort sounds way too long to explain in words atm since my brain is slowly turning to mush. I'll do it tomorrow or something. But I find that in order for me to absorb any info I need to restate it in my own words to get things straight.Â










