Exercise 2
You are given two sorted sequences stored in arrays X and Y of n and n 2 keys respectively. We
are interested in forming the union Z = X \cup Y, i.e. an array Z containing all keys of X and Y but
duplicates are included only once. Give a space and time efficient algorithm for solving this
problem. (Time efficient means its running time in terms of key comparisons cannot be
asymptotically improved upon.) Justify your arguments.