-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.cpp
More file actions
27 lines (26 loc) · 723 Bytes
/
node.cpp
File metadata and controls
27 lines (26 loc) · 723 Bytes
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
//node.cpp
#include "node.h"
#include <iostream> // std::cout
#include <string> // std::string, std::to_string
Node::Node(){
this->key = "";
std::vector<Node*>temp(26, nullptr);
this->children = temp;
this->numChildren = 0;
this->count = 0;
this->isWord = false;
};
Node::Node(char data){
std::string string(1, data);
this->key = string;
std::vector<Node*>temp(26, nullptr);
this->children = temp;
this->numChildren = 0;
this->count = 0;
this->isWord = false;
};
Node::Node(std::string data){
this->key = data;
this->isWord = true;
this->count = true;
};