-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD_tree.h
More file actions
50 lines (38 loc) · 1.69 KB
/
D_tree.h
File metadata and controls
50 lines (38 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <cstddef>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <vector>
#include <fstream>
#include <string>
#include <cctype>
#include "string-utility.h"
using namespace std;
namespace d_tree{
enum Error {OK, FAIL};
typedef string Label;
const Label emptyLabel = "$#$#$";
struct State;
struct IdLabel;
struct Elem;
struct treeNode;
typedef treeNode* Tree;
const Tree emptyTree = NULL;
Error addElem(const Label, const Label, const Label, Tree&);//insert element of Tree
Tree createEmpty();//create empty Tree
Error deleteElem(const Label, Tree&);// delete Tree node
Error modifyElem(const Label , const Label , const Label , const Tree& );// modify Tree node
void printTree(const Tree&, int);// print Tree
void printLabel(const Tree& t);// print Tree labels
Label predictionTree(const Label, const Label, const Label, const Label, const Tree&); // Tree prediction with all parameters
Label predictionTree_OnceByOne(const Tree&);// Tree prediction with the values one at a time
bool translation(const Label, const Label, const Label);// Translate and verify conditions
}
bool memberLabel(const d_tree::Label , const d_tree::Tree& );//check if exists label for example "Age"
bool member(const d_tree::Label l, const d_tree::Tree& t);// check if exists label + id for example "Age_1"
d_tree::Tree readFromFile(string); // read Tree from file
d_tree::Tree getNode(const d_tree::Label , const d_tree::Tree& ); //get node with that label
d_tree::Tree prevSibling(const d_tree::Label , const d_tree::Tree& ); //get prev sibling node of node with that label
d_tree::Label father(const d_tree::Label , const d_tree::Tree& ); //get father node of node with that label
struct Cell;
typedef Cell* List;