MIT6_042JF10_rec14

# MIT6_042JF10_rec14 - 6.042/18.062J Mathematics for Computer...

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
This is the end of the preview. Sign up to access the rest of the 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

## This note was uploaded on 01/19/2012 for the course CS 6.042J / 1 taught by Professor Tomleighton,dr.martenvandijk during the Fall '10 term at MIT.

### Page1 / 5

MIT6_042JF10_rec14 - 6.042/18.062J Mathematics for Computer...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online