CST 370 Week 4
WELCOME TO WEEK 4
Learning Journal - CST 370
This week, we learned about Merge Sort, which uses the divide and conquer technique. It splits an array A into two halves recursively until each subarray contains only one element. After that, the algorithm begins merging and comparing elements in order to place them in sorted order, combining them back into the original array. This process is done recursively.
The merge operation works by comparing the first elements of two subarrays, B and C. The smaller element is added to A, and the index (or pointer) of the corresponding subarray is incremented to move to the next element. This process continues until all elements from B and C have been merged into A, resulting in a fully sorted array.
The time efficiency of Merge Sort is determined using the Master Theorem. It falls under case 2, not case 3, meaning its time complexity is Θ(n log n). This makes Merge Sort an efficient algorithm, especially for large datasets, as it consistently performs better than quadratic sorting algorithms like Bubble Sort or Insertion Sort.
Overall, this was a really interesting algorithm to learn. There wasn’t a lot of material to cover this week since we had a midterm on Saturday, which gave me enough time to study and focus on creating my four study sheets. I had to carefully decide what to include, but I think I added really useful information because they were extremely helpful during the exam. There were a few things I left out, but I’ll know better for next time. I still don’t know my grade, but I’m hoping I did well on the midterm. Attending the Zoom meeting for the midterm review was really helpful. My classmates did a great job explaining the material and helping others understand the concepts better, which made reviewing much easier.
Comments
Post a Comment