ps2-questions.pdf - Introduction to Algorithms 6.006 Massachusetts Institute of Technology Instructors Jason Ku Julian Shun and Virginia Williams

ps2-questions.pdf - Introduction to Algorithms 6.006...

This preview shows page 1 - 2 out of 3 pages.

Introduction to Algorithms: 6.006 Massachusetts Institute of Technology September 13, 2019 Instructors: Jason Ku, Julian Shun, and Virginia Williams Problem Set 2 Problem Set 2 All parts are due on September 20, 2019 at 6PM . Please write your solutions in the L A T E X and Python templates provided. Aim for concise solutions; convoluted and obtuse descriptions might receive low marks, even when they are correct. Solutions should be submitted on the course website, and any code should be submitted for automated checking on alg.mit.edu . Problem 2-1. [10 points] Famy k -sort Merge sort is a divide-and-conquer algorithm based on the idea that merging two sorted arrays into one larger sorted array can be done in linear time. Recall that merge sort divides unsorted input into two equally-sized subarrays, recursively sorts them, and then merges them together. Famy Owler is a 6.006 student this semester and is curious how modifications to merge sort would affect its running time. Famy has found a way to generalize the merge step of merge sort to combine k size- m sorted arrays into one sorted array of size km in Θ( k 2 m ) time, for any positive integer k . Famy k -sort is a generalization of merge sort which splits an input array into k equal chunks, recursively sorts them, and then combines them using Famy’s merge.
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '14
  • Divide and conquer algorithm

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes