Which of the following statements is false regarding approac

Which of the following statements is false regarding approaches for determining if there are any duplicated keys in a dataset of N numbers (e.g., return 1 if one or more duplicates exist, otherwise return 0)? Mark (d) if all are true.

(a) Quicksort can be used to solve the problem in expected O(N log(N)) time.

(b) Hashing can be used to solve the problem in expected O(N) time.

(c) Mergesort can be used to solve the problem in O(N log(N)) time.

All of the above statements are true.

Solution

Quicksort can be used to solve the problem in expected O(N log(N)) time

Yes while partitioning the array if any value in the array matches with the partiton key then the duplicate exist

Hashing can be used to solve the problem in expected O(N) time.

Yes wile scanning the number put them in to a hash map now if same number comes again it will be present in the hash map and duplicate is found

Mergesort can be used to solve the problem in O(N log(N)) time.

Yes, while merging the array if you found two elements which are equal then return 1

Hence the answer is all the options are correct which is d

Which of the following statements is false regarding approaches for determining if there are any duplicated keys in a dataset of N numbers (e.g., return 1 if on

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site