In C++ please. Implement a trie-based map. A map stores data in the form of (key, value) pairs where every key is unique and each key maps to a value. You can assume that the keys are strings composed...


In C++ please.



Implement a trie-based map. A map stores data in the form of (key, value) pairs where every key is unique and each key maps to a value. You can assume that the keys are strings composed of lowercase letters only, and the values are positive integers. Implement the insert, search, and delete methods in trie.cpp. For delete, if you remove a leaf node, you do not need to remove redundant ancestors if there are any. For example, below is the result trie after the sequence of insertion ("to", 7), (“tea", 3), ("ten", 12), (“in", 5), (“inn", 9). Note that the size of the resulting map should be 5 and the size of the resulting tree should be 9.


Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here