⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sortthd.h

📁 C++ Builder 6 编程实例教程-北京希望电子出版社出版
💻 H
字号:
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1998-2002 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
#ifndef SortThdH
#define SortThdH
//----------------------------------------------------------------------------
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <System.hpp>
//----------------------------------------------------------------------------
extern void __fastcall PaintLine(TCanvas *Canvas, int i, int len);
//----------------------------------------------------------------------------
class TSortThread : public TThread
{
private: 
	TPaintBox *FBox;
	int *FSortArray;
	int FSize;
	int FA;
	int FB;
	int FI;
	int FJ;
	void __fastcall DoVisualSwap(void);
	
protected:
	virtual void __fastcall Execute(void);
	void __fastcall VisualSwap(int A, int B, int I, int J);
	virtual void __fastcall Sort(int *A, const int A_Size) = 0;
	
public:
	__fastcall TSortThread(TPaintBox *Box, int *SortArray, 
	    const int SortArray_Size);
};
//----------------------------------------------------------------------------
class TBubbleSort : public TSortThread
{
protected:
	virtual void __fastcall Sort(int *A, const int A_Size);
public:
	__fastcall TBubbleSort(TPaintBox *Box, int *SortArray, 
	    const int SortArray_Size);
};
//----------------------------------------------------------------------------
class TSelectionSort : public TSortThread
{
protected:
	virtual void __fastcall Sort(int *A, const int A_Size);
public:
	__fastcall TSelectionSort(TPaintBox *Box, int *SortArray, 
	    const int SortArray_Size);
};
//----------------------------------------------------------------------------
class TQuickSort : public TSortThread
{
protected:
	void __fastcall QuickSort(int *A, const int A_Size, int iLo, 
	  int iHi);
	virtual void __fastcall Sort(int *A, const int A_Size);
public:
	__fastcall TQuickSort(TPaintBox *Box, int *SortArray, 
	    const int SortArray_Size);
};
//----------------------------------------------------------------------------
#endif	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -