compositordlg.h

来自「实现了插入排序」· C头文件 代码 · 共 86 行

H
86
字号
// CompositorDlg.h : header file
//

#if !defined(AFX_COMPOSITORDLG_H__08DD291C_0A61_48F8_9665_F009178BE9AD__INCLUDED_)
#define AFX_COMPOSITORDLG_H__08DD291C_0A61_48F8_9665_F009178BE9AD__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CCompositorDlg dialog

class CCompositorDlg : public CDialog
{
// Construction
public:
	CCompositorDlg(CWnd* pParent = NULL);	// standard constructor
    int a[30001];
	int b[30001];
	int r[30001];
// Dialog Data
	//{{AFX_DATA(CCompositorDlg)
	enum { IDD = IDD_COMPOSITOR_DIALOG };
	double	m_compare;
	double	m_exchange;
	long	m_num;
	double	m_time;
	double	m_move;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCompositorDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCompositorDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButton1();
	afx_msg void OnButton2();
	afx_msg void OnButton3();
	afx_msg void OnButton4();
	afx_msg void OnButton5();
	afx_msg void OnButton6();
	afx_msg void OnButton7();
	afx_msg void OnExit();
	afx_msg void OnOk();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};
class paixu
{
public:
    double compare;  //元素比较次数
    double move;     //元素移动次数
    double exchange; //元素交换次数
	double time;
	void insertsort(int r[],long m,long n);
    void shellsort(int r[],long m,long n);
    void bubblesort(int r[],long m,long n);
    void quicksort(int r[],long s,long t);
	void selectsort(int r[],long m,long n);
    void heapsort(int r[],long n);
    void sortmerge(int a[],long p1,long p2,int b[]);
protected:
	clock_t start,end;   //时钟参量
	void quick(int r[],long s,long t);
	void sift(int r[],long l,long m);
	void merge(int a[],long s,long m,long n,int b[]);
	void mmergesort(int a[],long p1,long p2,long len,int b[]);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMPOSITORDLG_H__08DD291C_0A61_48F8_9665_F009178BE9AD__INCLUDED_)

⌨️ 快捷键说明

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