How can I implement the insertfunction for this Trie in C++? note that a string like “hit” canhave more than one value. For example:
void insert(const string& key, const ValueType&value)
Trie trie;
trie.insert(“hit”, 42); // hit {42}
trie.insert(“hit”, 17); //hit {42, 17}
trie.insert(“hit”, 42); // hit {42, 17, 42}
… but
trie.insert(“hat”, 7); // hat {7}
root value(s) value(s) value(s) value(s) children value(s) 9, 17 value(s) value(s) 22, 23 value(s) childrern ldr value(s) value(s) 10, 20 value(s) 7, 8,9 value(s) 19, 6, 32 children Show transcribed image
PayPal Gateway not configured
PayPal Gateway not configured