This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 15-121: Introduction to Data Structures Exercise 09/21/2009 Merging sorted arrays Fall 2009 Due: Wed, Sept 23 10:30am beginning of class Assignment: (worth 2 exercise points) For this exercise, you may work in pairs (no more than 2, though). If you do work in a pair, only submit one copy with both names on it. By putting two names on it, you are stating that both of you contributed significantly to the answer. 1) Complete the body of the following method:
/* Returns an array containing all of the items in array1 and all of the items in array2. The resulting array is SORTED. ASSUMES: array1 is sorted, and array2 is sorted */ public String merge(String array1, String array2) 2) in Big-Oh notation, what do you believe to be the runtime of your answer to number 1. 3) Look at the method "Merge" in the SortingAlgs sample program. Be prepared to discuss it in class. Handin: • Write up your answer neatly (handwritten is okay, but "typed" may be better). • Bring it to class on Wednesday and place it on the desk in the front of the room. • Be sure your name(s) AND section letter(s) are on the handin. ...
View Full Document