Write a method that accepts an integer array as a parameter and sorts it using the bubble sort algorithm.

What will be an ideal response?

```
public void bubbleSort(int[] array)
{
int temp;
for(int i = array.length-1; i >;=0; i--)
{
for(int j = 0; j < i; j++)
{
if(array[j] < array[j+1])
{
temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
}//end if
}//end for j
}//end for i
}
```

Computer Science & Information Technology

You might also like to view...

Assume a schedule consists of consistent transactions that execute in an isolated fashion except for one transaction that performs a single update that is lost (as in Figure 18.2). Showthat the final state of the database satisfies all integrity constraints but nevertheless is incorrect.

What will be an ideal response?

Computer Science & Information Technology

Refering to the accompanying figure, which of the following search options should be selected if you are looking for a word but are not sure how to spell it?

A. Match case B. Find whole words only C. Sounds like D. Nothing

Computer Science & Information Technology