chap internal sorting = figure an illustration of bubble sort each column shows the array after the iteration with the indicated value of in the outer for loop values above the line in each column have been sorted arrows indicate the swaps that take place during given iteration bubble sort our next sort is called bubble sort bubble sort is often taught to novice programmers in introductory computer science courses this is unfortunatebecause bubble sort has no redeeming features whatsoever it is relatively slow sortit is no easier to understand than insertion sortit does not correspond to any intuitive counterpart in "everydayuseand it has poor best-case running time howeverbubble sort serves as the basis for better sort that will be presented in section bubble sort consists of simple double for loop the first iteration of the inner for loop moves through the record array from bottom to topcomparing adjacent keys if the lower-indexed key' value is greater than its higher-indexed neighborthen the two values are swapped once the smallest value is encounteredthis process will cause it to "bubbleup to the top of the array the second pass through the array repeats this process howeverbecause we know that the smallest value reached the top of the array on the first passthere is no need to compare the top two elements on the second pass likewiseeach succeeding pass through the array compares adjacent elementslooking at one less value than the preceding pass figure illustrates bubble sort java implementation is as followsstatic void sort( [afor (int = < length- ++/bubble up 'th record for (int = length- >ij--if (( [jcompareto( [ - ] )dsutil swap(ajj- )