![](https://csdnimg.cn/release/download_crawler_static/87151239/bg4.jpg)
1.1 附件 1:ace 与 GBT19011-2008 标准主要差异性分析
整个快速排序的实现:
voidLinkList::QSort()
{
LARGE_INTEGER t1, t2, feq;
QueryPerformanceFrequency(&feq); //每秒跳动次数
QueryPerformanceCounter(&t1); //测前跳动次数
node * e = front;
while (e->next)
{
e = e->next;
}
QSZ(front, e);
QueryPerformanceCounter(&t2); //测后跳动次数
double d = ((double)t2.QuadPart - (double)t1.QuadPart) / ((double)feq.QuadPart);//时间差秒
cout << "操作时间为:" << d << endl;
}
3.改进版的冒泡排序:
通过设置pos来记录无序边界的位置以减少比较次数。
将数据从前向后两两比较,遇到顺序不对是直接交换两数据的值。
每交换一次movef+3;
voidLinkList::BubbleSort()
{
LARGE_INTEGER t1, t2, feq;
QueryPerformanceFrequency(&feq); //每秒跳动次数
QueryPerformanceCounter(&t1); //测前跳动次数
node * p = front->next;
while (p->next) // 排序查找无序边界
{
comparef++;
if (p->data > p->next->data)
turn(p, p->next);
p = p->next;
}
node * pos = p; p = front->next;
while (pos != front->next)
{
node * bound = pos;
pos = front->next;
while (p->next != bound)
{
comparef++;
if (p->data > p->next->data)
{
turn(p, p->next); pos = p->next;
}
4d