Question: Problem 1 . ( 3 0 MARKs ) Consider an array of numbers that contain duplicates, i . e . [ 9 , 1 1
Problem
MARKs Consider an array of numbers that contain duplicates, ie Develop a divideandconquer algorithm to remove duplicates preserving the original order of the elements. For the array above, the algorithm must output specifically for each duplicate, only the first one must survive Your algorithm must perform in n log n time where N is the size of the input. Your function must have signature removeduplicatesA low, high where A is an array of length highlow Your function must return nothing and update A in place.
i marks Write the algorithm in pseudocode. No explanation is required, just the algorithm. You are not allowed to use sorting for this.
ii marks Compute the time complexity of your algorithm using Master Theorem. Write the details of step counting and justify the use of Master Theorem.
iii marks Using strong induction on the size of the input, prove the correctness of your algorithm.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
