In given list of n elements, we need to find the first repeated element. Which of the

Question:

In given list of n elements, we need to find the first repeated element.

Which of the following methods will work for us. If a method works, then implement it.

• Brute force exhaustive search.

• Use Hash-Table to keep an index of the elements and use the second scan to find the element.

• Sorting the elements.

• If we know the range of the element then we can use counting technique.

When order in which elements appear in input is important, we cannot use sorting.image text in transcribed

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: