Question: Can someone help me with this question pls?? Given an array of N elements, you notice that there are some duplicate values. Implement a modified

Can someone help me with this question pls??  Can someone help me with this question pls?? Given an array

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. Note: You may assume all elements in the original array are positive, and fill in empty" spots with- Example input: Example correct outputs from example input: 1 2 3 4 568 91 1 1 2 3 4 56 8 9 Any of the above is correct. As long as there are no duplicate positive numbers, and as long as positive numbers are in sorted order if all -1 elements are ignored, the output would correct. You don't need to sort the -1's

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!