I know what is the meaning of sort. But recently i hear the Bubble sort. So tell me please what is Bubble Sort?
Read the Wikipedia page for "Bubble Sort". But generally, you don't need to know how the sorting is done. Just use "order by" in your SQL and the database will do the sorting for you.
So, basically if you want to sort 4,3,2,1 using bubble sort, you'd do: Compare 4 with 3, if 4 is larger we swap. We repeat this till 4 is compared with every other element. So... 3|4|2|1 Swapped 3 and 4 3|2|4|1 Swapped 2 and 4 3|2|1|4 Swapped 1 and 4 Now we do the same for 3. 2|3|1|4 Swap 2 and 3 2|1|3|4 Swap 3 and 1 2|1|3|4 Since 3 is not greater than 4, we don't swap. Lastly we do this for 2. After this we get 1|2|3|4 It's rather slow and most databases use better sorting algorithms like Quick Sort or Merge Sort.
Bubble sort is also a type of algorithm which is use to sort the given set of number . you could read about it more from wikipedia or search engine
Bubble Sorting is an algorithm in which we are comparing first two values and put the larger one at higher index. Then we take next two values compare these values and place larger value at higher index. This process do iteratively until the largest value is not reached at last index. Then start again from zero index up to n-1 index. The algorithm follows the same steps iteratively unlit elements are not sorted. In Term of java this is simple program : public class bubbleSort{ public static void main(String a[]){ int i; int array[] = {12,9,4,99,120,1,3,10}; System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++) System.out.print( array+" "); System.out.println(); bubble_srt(array, array.length); System.out.print("Values after the sort:\n"); for(i = 0; i <array.length; i++) System.out.print(array+" "); System.out.println(); System.out.println("PAUSE"); } public static void bubble_srt( int a[], int n ){ int i, j,t=0; for(i = 0; i < n; i++){ for(j = 1; j < (n-i); j++){ if(a[j-1] > a[j]){ t = a[j-1]; a[j-1]=a[j]; a[j]=t; } } } }