5. (20 points) You have to organize a dynamic set of the following records:
Last Name
First Name
SSN
You need to support searches on (Last Name, First Name) only. The requirement is to have
$\theta(\lg n)$ worst case running time on operations of INSERT, DELETE, and SELECT on the data
structure, where n is the number of distinct (Last Name, First Name) pairs in the set. In addition,
you need to output the sorted array of all the records in the form
Abel, Peter, 720-xx-xxxx
Smith, John, 721-xx-xxx
Smith, John, 720-xx-xxx
Webster, Kelly, 725-xx-xxxx
As you can see, the pair (Last Name, First Name) might not be unique. However, when you need
to produce a sorted array, the sorting should only be related to (Last Name, First Name). There
is no requirement on SSN's to be sorted (in the example above, there are two John Smith's, and
their SSNs did not get sorted). However, there is a requirement on the worst-case running time
of producing the array of records. It has to be $\theta(n)$.
Please describe the underlying data structure you are going to use, and justify the worst-case
running times. If you are taking a well-known data structure as a base structure, you might
reference the worst-case running times for that data structure, and relate them to the works
case running times of your (modified) data structure.