Wrong algorithmTugdual de Kerviler February 21, 2013 at 5:55 PM
Please remove this wrong algorithm from the Internet.
This is not a correct merge sort : the insertion of an element in the merge part is in O(n) which makes the algorithm run in O(n²log(n)).
Can you show me how to merge two class database using string . For example , First class database consist of 8 students and the second consist of 10 students . Thank you :)
public class isort{
public static void main(String args[]) {
int arr[] = {2,1,4,5,3};
int temp;
System.out.print ("THE NUMBERS ARE; ");
for (int b = 0; b<=4;b++){
System.out.print(arr[b]+" ");
}
System.out.println();
for (int x = 0; x<=3;x++){
for (int y = x+1; y<=1;y++){
System.out.println("CHECK INDEX"+x+"&"+y);
System.out.print("VALUE AFTER CHECK: ");
if (arr[x] > arr[y]){
temp = arr[x];
arr[x] = arr[y];
arr[y] = temp;
}
for (int a=2;a>0;a++){
}
for (int b=0;b<=4;b++){
System.out.print(arr[b]+" ");
}
System.out.println();
System.out.println();
}
}
}
}
computersuraj Tripathi July 29, 2011 at 4:17 PM
thanks......... good work..........
Wrong algorithmTugdual de Kerviler February 21, 2013 at 5:55 PM
Please remove this wrong algorithm from the Internet. This is not a correct merge sort : the insertion of an element in the merge part is in O(n) which makes the algorithm run in O(n²log(n)).
Download link errorAKGN November 23, 2011 at 5:16 PM
the given download link given for merge sort is different. Its a download link of bubble sort program. Please update it.
wrong algoshrikant December 12, 2011 at 4:53 AM
even though the sorting works ... it dosent look like an implementation of the merge sort
Computer Programming (Mergesort in String)Chin Hang January 16, 2013 at 4:08 PM
Can you show me how to merge two class database using string . For example , First class database consist of 8 students and the second consist of 10 students . Thank you :)
Why Selectin Sort is written in SOPMANISH SHARMA February 15, 2012 at 11:14 PM
Why Selectin Sort is written in SOP
sir please write a code using with thisOctopusPrim3 March 23, 2012 at 12:43 PM
public class isort{ public static void main(String args[]) { int arr[] = {2,1,4,5,3}; int temp; System.out.print ("THE NUMBERS ARE; "); for (int b = 0; b<=4;b++){ System.out.print(arr[b]+" "); } System.out.println(); for (int x = 0; x<=3;x++){ for (int y = x+1; y<=1;y++){ System.out.println("CHECK INDEX"+x+"&"+y); System.out.print("VALUE AFTER CHECK: "); if (arr[x] > arr[y]){ temp = arr[x]; arr[x] = arr[y]; arr[y] = temp; } for (int a=2;a>0;a++){ } for (int b=0;b<=4;b++){ System.out.print(arr[b]+" "); } System.out.println(); System.out.println(); } } } }
Filename is Bubblesort.javaHarry June 2, 2012 at 4:13 PM
Downloading the example downloads a Bubblesort algorithm, not mergesort.
Post your Comment