arunnambiar1994 Active member
| Subject: :::Urgent Help:::Please Reply Sun Jun 28, 2009 5:57 pm | |
| 1.>What is selection sort? 2.>What is bubble sort? 3.>What Is binary search? 4.>How to handle 2d array?
please can anyone help me.if posssible with the code.
I AM IN A VERGE OF DANGER
I hope I will get reply.
I AM LIKE A SINKING SHIP IN COMPUTER. HELPPPPPPPP!!! |
|
abhas Active member
| |
arunnambiar1994 Active member
| Subject: Re: :::Urgent Help:::Please Reply Sun Jun 28, 2009 9:07 pm | |
| Though I Need The Code I Am Having Trouble In Understanding It.Could You Please Help Me. |
|
^snigdha^ Active member
| Subject: Re: :::Urgent Help:::Please Reply Wed Jul 15, 2009 11:58 pm | |
| maybe dis helps..- class ExchangeSelectionSort { public void cal() { int a[]={26, 49, 3, 0, 10}; int i,j,temp,len=a.length,pos,min; for(i=0; i<len-1; i++) { min=a[i]; pos=i; for(j=i+1; j<len; j++) { if(a[j]<min) { min=a[j]; pos=j; } temp=a[i]; a[i]=a[pos]; a[pos]=temp; } } for(i=0; i<len; i++) System.out.print(a[i] + "\t"); } } class BubbleSort { public void genOrder() { int a[]={86, 59, 12, 16, 40}; int i,j,temp,len=a.length; for(i=0; i<len-1; i++) { for(j=i+1; j<len; j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } System.out.println("Printing the sorted array......"); for(i=0; i<len; i++) { System.out.print(a[i] + "\t"); } } }
class BinarySearch { public void disp(int n) { int a[]={3,5,9,15,21,26,40,51,56,58,68,72}; int upper=a.length-1, lower=0, mid=0, flag=0; while(lower<=upper) { mid=(lower+upper)/2; if(n==a[mid]) { flag=1; break; } else if(n>a[mid]) lower=mid+1; else upper=mid-1; } if(flag==1) System.out.println("Found at " + (mid+1)); else System.out.println("Not found"); } } |
|
arunnambiar1994 Active member
| Subject: Re: :::Urgent Help:::Please Reply Thu Jul 16, 2009 6:14 pm | |
| tanx |
|
Sponsored content
| Subject: Re: :::Urgent Help:::Please Reply | |
|
|
|