Doublehranch5402 Doublehranch5402
  • 24-02-2020
  • Computers and Technology
contestada

g what does the following piece of code do a) Print the duplicate elements in the array b) Print the element with maximum frequency c) Print the unique elements in the array d) None of the mentioned

Respuesta :

colocho08
colocho08 colocho08
  • 03-03-2020

Answer:

a) Print the duplicate elements in the array

Explanation:

I found this code:

This is two for cycle, where we make a comparison among two variables i and j to print duplicate elements.

for (int i=0; i < arr.length-1; i++)

{

for (int j = i+1; j < arr.length; j++)

 {

   if (( arr[i].equals(arr[j])) && (i != j))

       {

         System.out.println(arr[i])

}

}

}

Answer Link

Otras preguntas

A neuron transfers information in the form of an electrical impulse True..or False?
What is the equation in standard form of y=5/8x-9
Does every religion have the potential to become a global religion? Or are some religions destined to remain local?
how to write forty thousand, six hundred nine teen in standard form
what is it called when men poke his key into a girl's hole?
The largest one week drop of the Dow Jones occurred the week the Dow Jones reopened after 9/11.
what is required for the planet to support weather systems
why is the ketboard calledQWERTY
How do you work out 460 divided by 20 without a calculator?
Which of the following sentences contains a verb in the simple past tense?