for (int i = 0; i < arr.length-1; i++)
{
for (int j = i+1; j < arr.length; j++)
{
if( (arr.equals(arr[j])) && (i != j) )
{
System.out.println(arr);
}
}
}
a) Print the duplicate elements in the array
b) Print the element with maximum frequency
c) Print the unique elements in the array
d) Prints the element with minimum frequnecy
What does the following piece of code do?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What does the following piece of code do?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!