Computer Science, asked by anniejerrade, 1 day ago

Accessing each element of an array is called

Answers

Answered by Levantsai
0

Answer:

Method-1: Using Sorting.

Sort the array.

Check for each element at index i (except the first and last element), if arr[i] != arr[i-1] && arr [i] != arr[i+1]

For the first element, check if arr[0] != arr[1].

For the last element, check if arr[n-1] != arr[n-2].

Explanation:

Similar questions