MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / getNode

Method getNode

CPP/Tries/implementTrie.cpp:18–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16class Trie {
17 Node* root;
18 Node* getNode(string &s){
19 Node* curr = root;
20 for(auto &ch:s){
21 if(curr -> child[ch - 97] == NULL)
22 return NULL;
23 curr = curr -> child[ch - 97];
24 }
25
26 return curr;
27 }
28public:
29 Trie() {
30 root = new Node('\0');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected