© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies


CPP Program To Implement Shell Sort:

#include #include class ShellSort { public: int i,j,k,n,temp,array[25]; void shell(int a[],int n); }; void ShellSort :: shell(int a[],int n) { for(i=(n+1)/2;i>=1;i/=2) { for(j=i;j<=n-1;j++) { temp=a[j]; k=j-i; while(k>=0&&temp>obj.n; cout<<"\n Enter the elements\n\n"; for(int j=0;j>obj.array[j]; obj.shell(obj.array,obj.n); cout<<"\n Sorted list : "; for(int i=0;i

SAMPLE INPUT AND OUTPUT:

 Enter the limit: 5

Enter the elements

5
4
3
2
1

Sorted list:

1
2
3
4
5

 
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom