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

Fat molecules are broken down into fatty acids by ____________. bile enzymes sphincters emulsifiers
Protists that play an important role in aquatic food webs are called
A cube has six congruent faces that are all _____
who is ronaldos dad son monther
the what are currently known as the oldest civilization
Write a function elapsed_time that takes as its arguments two time structures and returns a time structure that represents the elapsed time (in hours, minutes,
(“What is the effect of temperature on the solubility of a solid in a liquid?”)
which breed of rabbit originated in indiana by walter huey
How did Jack Cole influence the development of modern jazz?
If an individual allele has more than one effect on the phenotype, this is called