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.118.2, 14.114.3, 33.133.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 51. Joining and Splitting 234 Trees The JOIN operator takes as input two 234 trees, and , and an element such that for any and , we have . As output JOIN returns a 234 tree containing the node and all the elements of and . The SPLIT operator is like an “inverse” JOIN: given a 234 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
This note was uploaded on 10/08/2009 for the course EECS 6.046 taught by Professor Erikdemaine during the Spring '04 term at MIT.
 Spring '04
 ErikDemaine
 Algorithms

Click to edit the document details