Question: ( 2 Marks ) The following algorithm takes as input an array, and returns the array with all the duplicate elements removed. For example, if
Marks
The following algorithm takes as input an array, and returns the array with all the duplicate elements removed. For example, if the input array is the algorithm returns
new empty set
new erpoty dynamic array
for every element in input array
if not Smemberx then
Sinsertx
Dappend
return D
What is the bigO complexity of this algorithm, if the set is implemented as
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
