Question: Suppose we have an array that contains tuples. These tuple contains three positive numbers. Implement an algorithm that counts how many distinct tuple that an

Suppose we have an array that contains tuples. These tuple contains three positive numbers.

Implement an algorithm that counts how many distinct tuple that an array has(contains same number in same order).

ex) [(1, 2, 1), (2, 2, 2), (3, 8, 3), (1, 2, 1), (3, 4, 3)] gives 4.

1 The algorithm should be implemented in Python3.

2 The function must have average-case runtime of O(n). You can assume Simple Uniform Random Hashing.

3 Python built-in dictionary cannot be used.

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!