Algorithms & Data Structures Question

You will implement a duplicate checker from a given list of words.

Input: [‘homework’, ‘assignment’, ‘quiz’, ‘discussion’, ‘quiz’, ‘program’]

Output: Yes, there is a duplicate. [e.g. ‘quiz’]

1. Implement a program of O(N^2) runtime complexity of the above duplicate checker.

2. Implement a program of O(N) runtime complexity of the above duplicate checker and explain

how you have achieved. [Hint: use hash map]

You can choose either C#, Python, Java to implement 1 & 2.

SAMPLE ASSIGNMENT
Powered by WordPress