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

📄 heapsortdlg.h

📁 此程序实现了堆排序,并且使用了MFC的图形界面,非常实用
💻 H
字号:
// HeapSortDlg.h : header file
//

#if !defined(AFX_HEAPSORTDLG_H__30385415_3483_4E46_ACE9_8447DBE4D5B8__INCLUDED_)
#define AFX_HEAPSORTDLG_H__30385415_3483_4E46_ACE9_8447DBE4D5B8__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CHeapSortDlg dialog

class CHeapSortDlg : public CDialog
{
// Construction
public:
	void NoNeedSort();
	void SortEnd();
	UINT m_Timer;
	void HeapSort(int array[],int length);
	void HeapAdjust(int array[],int i,int length);
	void Swap(int *a, int *b);
	void OnNextStep();
	void GetHeapTop(CString &top,CString st);
	void ChangeNumberToString(CString &st,int list[]);
	void OnDisplayList();
	int  m_nNumber[7];									       //输入元素数组
	int  m_nStep;											   //总步数
	int  m_nNow;											   //现在步数	
	CString m_spShow[100];                                     //演示数组 
	int  m_nList[100][7];										   //整数形式演示数组	
	CHeapSortDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CHeapSortDlg)
	enum { IDD = IDD_HEAPSORT_DIALOG };
	CButton	m_bStart;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CHeapSortDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnInputNumber();
	afx_msg void OnHeapsort();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_HEAPSORTDLG_H__30385415_3483_4E46_ACE9_8447DBE4D5B8__INCLUDED_)

⌨️ 快捷键说明

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