Question: Say that elements have two keys. key1 is not unique, namely, there may be many elements with the same key1. But each element also has
Say that elements have two keys. key1 is not unique, namely, there may be many elements with the same key1. But each element also has key2, so that the second keys are pairwise disjoint. The keys are numbers. Show how to implement the following operations:
F ind(S, key1(x), key2(x)) that finds the unique element with these two keys.
Also, implement Insert(S, k1, k2) that adds into S an elements with first key k1 and second key k2. Finally the data structure should be able to do Delete(S, k1) with k1 some valid first key. This means that you want to remove all whose first key is k1.
***PLEASE EXPLAIN AND/OR USE PSEUDOCODE. DO NOT USE CODE IN THIS ANSWER.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
