decisiontree.h

来自「A simple decision tree c++ implementatio」· C头文件 代码 · 共 35 行

H
35
字号
// DecisionTree.h: interface for the DecisionTree class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DECISIONTREE_H__FCC1D907_3482_4CD4_9FB8_4352829DF1B4__INCLUDED_)
#define AFX_DECISIONTREE_H__FCC1D907_3482_4CD4_9FB8_4352829DF1B4__INCLUDED_

#include "TreeNode.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class DecisionTree  
{
public:
	void RemoveNode(TreeNode* node);
	void OutputBinaryTree(string tag, TreeNode* currentNode);
	void Output();
	void AskQuestion(TreeNode* node);
	void Query();
	void QueryBinaryTree(TreeNode* rootNode);
	bool SearchTreeAndAddNoNode(TreeNode* currentNode, int existingNodeID, int newNodeID, string newQorA);
	void AddNoNode(int existingNodeID, int newNodeID, string newQorA);
	bool SearchTreeAndAddYesNode(TreeNode* currentNode, int existingNodeID, int newNodeID, string newQorA);
	void AddYesNode(int existingNodeID, int newNodeID, string newQorA);
	void CreateRootNode(int nodeID, string newQorA);
	//the key root node to which all other nodes are added.
	TreeNode* m_pRootNode;
	DecisionTree();
	virtual ~DecisionTree();

};

#endif // !defined(AFX_DECISIONTREE_H__FCC1D907_3482_4CD4_9FB8_4352829DF1B4__INCLUDED_)

⌨️ 快捷键说明

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