C++求逆序对的方法

上传:huasheng11308 浏览: 13 推荐: 0 文件:PDF 大小:33.99KB 上传时间:2021-01-15 14:03:00 版权申诉
本文实例讲述了C++求逆序对的方法,分享给大家供大家参考之用。具体实现方法如下: #include #include using namespace std; int array[] = {3, 9, 7, 4, 5, 2}; const int size = sizeof array / sizeof *array; int temp[size]; //int numbers[size]; int reversePair(int *numbers, int start, int last, int &index, int &count) { if(
上传资源
用户评论