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

📄 bitreedlg.h

📁 实现各种二叉树的遍历。包括先序遍历、中序遍历、后序遍历的递归或递 归算法。
💻 H
字号:
// BiTreeDlg.h : header file
//

#if !defined(AFX_BITREEDLG_H__95847DFE_5C9A_45E7_BE10_0F3695C83525__INCLUDED_)
#define AFX_BITREEDLG_H__95847DFE_5C9A_45E7_BE10_0F3695C83525__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CBiTreeDlg dialog
#define MAX 100
typedef char ElemType;//定义二叉树结点值的类型为字符型
typedef struct Bnode{
ElemType data;
struct Bnode *lchild,*rchild;
}Bnode,* BiTree;
//*******************************************************
typedef struct{
 Bnode *node;
 int flag;
}DataType;
//*******************************************************
template<class T>
class Stack{
 T data[MAX];
 int top;
public:
	void Init_SeqStack();
	int Pop_SeqStack(T *x);
	int Push_SeqStack(T x);
	int Empty_SeqStack();
};
//******************************************************


class CBiTreeDlg : public CDialog
{
// Construction
public:
	CBiTreeDlg(CWnd* pParent = NULL);	// standard constructor
void InOrderTraverse(BiTree bt);
 void CreateBiTree(BiTree &bt,CString &code);
 void CInOrderTraverse(BiTree bt);
 void PostOrderTraverse(BiTree bt);
 void CPostOrderTraverse(BiTree bt);
 void LevelOrderTraverse(BiTree bt);
 
 void PreOrderTraverse(BiTree bt);
 void CPreOrderTraverse(BiTree bt);


// Dialog Data
	//{{AFX_DATA(CBiTreeDlg)
	enum { IDD = IDD_BITREE_DIALOG };
	CString	m_a;
	CString	m_b;
	CString	m_c;
	CString	m_d;
	CString	m_e;
	//}}AFX_DATA
	BiTree root;

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CBiTreeDlg)
	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 OnButton8();
	afx_msg void OnButton9();
	afx_msg void OnButton11();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_BITREEDLG_H__95847DFE_5C9A_55E7_BE10_0F3695C83525__INCLUDED_)

⌨️ 快捷键说明

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