?? bubblesort.cpp
字號:
#include "StdAfx.h"
#include ".\bubblesort.h"
CBubbleSort::CBubbleSort(void)
{
}
CBubbleSort::~CBubbleSort(void)
{
}
void CBubbleSort::Sort(int* pData, int nLen)
{
int i;
int nTemp;
BOOL bSwap;
bSwap = TRUE;
while(bSwap){
bSwap = FALSE;
for(i=0;i<nLen-1;i++){
if(pData[i]>pData[i+1]){
//交換數據
nTemp = pData[i];
pData[i] = pData[i+1];
pData[i+1] = nTemp;
bSwap = TRUE;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -