Question: Given an array of N elements, you notice that there are some duplicate values. Implement a modified merge function such that the mergesort code we
Given an array of N elements, you notice that there are some duplicate values. Implement a modified merge function such that the mergesort code we saw in class both sorts the array and removes all duplicates from the array. Your algorithm should run in O(N log N) time; briefly argue/justify that your program runs in O(N log N) time. Note: You are not allowed to simply call mergesort, and then remove duplicates by scanning the array after sorting it. You must modify the merge function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
