📄 main.cpp
字号:
#include "TreeNode.h"
#include "DecisionTree.h"
#include <conio.h>
#include <iostream>
int main(int argc, char* argv)
{
//create he new decision tree object
DecisionTree* newTree = new DecisionTree();
//add the required root node
newTree->CreateRootNode(1,"Have you got a weapon?");
//add subsequent nodes based on problem definition
newTree->AddYesNode(1,2,"Are you close enough to attack?");
newTree->AddNoNode(1,3,"Can you tackle bare-handed?");
newTree->AddYesNode(2, 4, "Attack!!!");
newTree->AddNoNode(2, 5, "Don't attack!!!");
newTree->AddYesNode(3, 6, "Attack!!!");
newTree->AddNoNode(3, 7, "Don't attack!!!");
//output the created tree
newTree->Output();
//query the tree
newTree->Query();
cout << endl << "Press any key to quit..." << endl;
//pause
getch();
delete newTree;
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -