Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CTest void testRemoveDuplicates ( ) & / / Java 1 Review.removeDuplicates looks for integers that appear more / / than once in a given array.

CTest
void testRemoveDuplicates () &
// Java1Review.removeDuplicates looks for integers that appear more
// than once in a given array. If an integer has duplicates, the method
// replaces each appearance of the integer with 0.
int [] array ={451};
Java1Review removeDuplicates (array) ;
assertArrayEquals (new int []{451}, array);
array = new int []{451,451};
JavalReview . removeDuplicates (array) ;
assertArrayquals (new int []{0,0}, array) ;
array = new int []{451,451,451};
Java1Review - removeDuplicates (array) ;
assertArrayPquals (new int[]{0,0,0}, array);
array = new int []{451,451,42,451};
Java1Review , removeDuplicates (array) ;
assertArraypquals (new int []{0,0,42,0}, array) ;
array = new int []{451,451,42,451,101};
JavalReview. removeDuplicates (array) ;
assertArrayquals (new int[]{0,0,42,0,101}, array) ;
array = new int []{451,101,451,42,451,101};
JavalReview - removeDuplicates (array) ;
assertArravBouals (new int {1,0,0,0,42,0,0
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions