One, if the function you are calling/program you are using aren't putting a return in with \n (newline) too, then its two bytes.
Explanation:
People use freeware software because it is available free of cost and it can be distributed free of cost, that is why it is called FREEware.
Freeware software:
Adobe PDF
yahoo messenger
Go.ogle Talk
MSN messenger
People use shareware software because it helps them to know about the product more before buying it and this software is available free of cost.
Shareware software:
Adobe acrobat 8 professional
Winzip
Getright
Answer:
static int [] bubbleSort(int[] arr) {
int n = arr.length;
int temp = 0;
for(int i=0; i < n; i++){
for(int j=1; j < (n-i); j++){
if(arr[j-1] > arr[j]){
temp = arr[j-1];
arr[j-1] = arr[j];
arr[j] = temp;
}
}
}
return arr;
}
Explanation:
Above function is written in java language in which it takes integer array then sorts it using bubble sort and return back the array. The function has return type int[] which is necessary for returning array of type integer. The variable n contains the size of array which is calculated through array's length method which is built in. Above function sorts array in descending order if you want to sort it in ascending order just change the condition of in if branch from <em>"</em><em>if(</em><em>arr[j-1] > arr[j]</em><em>)</em><em>"</em> to <em>"</em><em>if(</em><em>arr[j-1] < arr[j]</em><em>)</em><em>"</em> means replace > sign with < sign .