treenode.cpp

来自「A simple decision tree c++ implementatio」· C++ 代码 · 共 33 行

CPP
33
字号
// TreeNode.cpp: implementation of the TreeNode class.
//
//////////////////////////////////////////////////////////////////////

#include "TreeNode.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

TreeNode::TreeNode()
{
	//set the objects pointers to NULL in default constructor
	m_pYesBranch = NULL;
	m_pNoBranch= NULL;
	m_iNodeID = 0;
}

TreeNode::~TreeNode()
{

}

TreeNode::TreeNode(int nodeID, string newQorA)
{
	//create a tree node with a specific node id and string
	m_iNodeID = nodeID;
	m_strQuestOrAns = newQorA;
	//ensure pointers are set to NULL in the new node
	m_pYesBranch = NULL;
	m_pNoBranch= NULL;
}

⌨️ 快捷键说明

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