CST 370 Week 4
This week, I continued to learn about the divide and conquer approach to solving problems. The class lessons used merge sorting as example to demonstrate how divide and conquer algorithms can be implemented. An unsorted array is repeatedly split in half into sub arrays until the sub arrays are one element in size. At this point, the sub arrays are considered to be sorted and can be merged back together in a sorted order. This is repeated until all the sorted sub arrays are merged in order. Using the master theorem, I was shown how this sorting method results in n*log n order of growth. In community college, I had to show how many operations had to occur for sorting an array of n size by counting operations at each step of the algorithm. Learning how to apply the master theorem to merge sorting has made understanding time complexities much simpler.
Comments
Post a Comment