Search found 3 matches

by tanjima09
Thu Aug 13, 2009 7:22 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22361

Re: 10327 - Flip Sort

thanks for ur reply.nw i understand where the problem was actually... yes i got an AC.. anywaz. i can do that by bubble sort. but i use those functions just because i want to. another thing is that <algo.h> is a very old name from STL HP implementation.thnx for helping :)
by tanjima09
Wed Aug 12, 2009 10:27 am
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22361

Re: 10327 - Flip Sort

#include <iostream> #include <algorithm> #include <algo.h> using namespace std; int main () { int a[1002],n,i,count=0; while(cin >> n) { if(n<=0) break; count=0; for (i=0; i<n; i++) cin >>a[i]; while (!is_sorted(a,a+n)) { for (i=0; i<n; i++) { if (a[i]>a[i+1]) { swap(a[i], a[i+1]); count++; } } } c...
by tanjima09
Wed Aug 12, 2009 10:12 am
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22361

Re: 10327 - Flip Sort

#include <iostream> #include <algorithm> #include <algo.h> using namespace std; int main () { int a[1002],n,i,count=0; while(cin >> n) { if(n<=0) break; count=0; for (i=0; i<n; i++) cin >>a ; while (!is_sorted(a,a+n)) { for (i=0; i<n; i++) { if (a >a[i+1]) { swap(a , a[i+1]); count++; } } } cout<<"M...

Go to advanced search