Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
几点提示In Reply To:为了做这道题,我提交了上百次,靠 提交率掉了多少... Posted by:orangelegend at 2007-02-04 00:33:14 1.选择排序---> 2.快速排序---> 3.发现stdlib里居然有个qsort-----> 4.将case改为数组定位----> 5.对快速排序进行优化, if(a[1]>a[mid]&&a[mid]>a[n]||a[1]<a[mid]&&a[mid]<a[n]){ temp=a[1]; a[1]=a[mid]; a[mid]=temp; } else if(a[1]>a[n]&&a[n]>a[mid]||a[1]<a[n]&&a[n]<a[mid]){ temp=a[1]; a[1]=a[n]; a[n]=temp; } ac Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator