This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 6.042/18.062J Mathematics for Computer Science October 24, 2006 Tom Leighton and Marten van Dijk Problems for Recitation 14 1 TriMergeSort We noted in lecture that reducing the size of subproblems is much more important to the speed of an algorithm than reducing the number of additional steps per call. Lets see if we can improve the ( n log n ) bound on MergeSort from lecture. Lets consider a new version of MergeSort called TriMergeSort , where the size n list is now broken into three sublists of size n/ 3, which are sorted recursively and then merged. Since we know that oors and ceilings do not affect the asymptotic solution to a recurrence, lets assume that n is a power of 3. 1. How many comparisons are needed to merge three lists of 1 item each? 2. In the worst case, how many comparisons are needed to merge three lists of n/ 3 items, where n is a power of 3? 3. Define a divide-and-conquer recurrence for this algorithm. Let T ( n ) be the number of comparisons to sort a...
View Full Document