only one iteration of the inner loop for each iteration of the outer loop thusin this casewe perform minimum number of comparisons of coursewe might have to do lot more work than this if the input array is extremely out of order in factwe will have to do the most work if the input array is in decreasing order java util methods for arrays and random numbers because arrays are so importantjava provides number of built-in methods for performing common tasks on arrays these methods appear as static methods in the java util arrays class that isthey are associated with the classjava util arrays itselfand not with particular instance of this class describing some of these methods will have to waithoweveruntil later in this book (when we discuss the concept that these methods are based onsome simple methods of java util arrays we list below some simple methods of class java util arrays that need no further explanationequals(ab)returns true if and only if the array and the array are equal two arrays are considered equal if they have the same number of elements and every corresponding pair of elements in the two arrays are equal that isa and have the same elements in the same order fill( , )stores element into every cell of array sort( )sorts the array using the natural ordering of its elements tostring( )returns string representation of the array for examplethe following string would be returned by the method tostring called on an array of integers [ , , , , , , ][ note thatfrom the list abovejava has built-in sorting algorithm this is not the insertion-sort algorithm we presented abovehowever it is an algorithm called quick-sortwhich usually runs much faster than insertion--sort we discuss the quick-sort algorithm in section an example using pseudo-random numbers