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: Introduction to Algorithms March 19, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Handout 15 Problem Set 5 Reading: Chapters 18.1-18.2, 14.1-14.3, 33.1-33.3, Skip Lists Handout There are four problems. Each problem is to be done on a separate sheet (or sheets) of paper. Mark the top of each sheet with your name, the course number, the problem number, your recitation section, the date, and the names of any students with whom you collaborated. As on previous assignments, give an algorithm entails providing a description, proof, and runtime analysis. Problem 5-1. Joining and Splitting 2-3-4 Trees The JOIN operator takes as input two 2-3-4 trees, and , and an element such that for any and , we have . As output JOIN returns a 2-3-4 tree containing the node and all the elements of and . The SPLIT operator is like an inverse JOIN: given a 2-3-4 tree and an element , SPLIT creates a tree consisting of all elements in whose keys are less than , and a tree consisting of all elements in whose keys are greater than . In this problem, we will efficiently implement JOIN and SPLIT. For convenience, you may assume that all elements have unique keys....
View Full Document
- Spring '04