
排序算法
TheKingofC
brew
展开
-
直接排序算法
// StraightInsertionSort.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "stdlib.h"enum{ GARD_VALUE_INDX = 0, MAX_BUFFER = 101,}; //pBuffer[0]做为哨兵值,不参与排序void StraightInsertionSort(int *pB原创 2009-10-29 08:35:00 · 755 阅读 · 0 评论 -
冒泡排序的实现
void Bubble(int *nSource, int nSize) { static int nTime = 0; for (int nOutId=0; nOutId { ++nTime; bool bNoSwitch = true; for (int nInerId=0; nInerId { if (nSource[nInerId] > nSour原创 2014-05-13 09:14:15 · 608 阅读 · 0 评论