heapsortdlg.h
来自「此程序实现了堆排序,并且使用了MFC的图形界面,非常实用」· C头文件 代码 · 共 68 行
H
68 行
// 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 + =
减小字号Ctrl + -
显示快捷键?