Data Str & Algorithm HW Solutions 83

Data Str & Algorithm HW Solutions 83 - 83 3 /\ / 31...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
83 3 3 14 95 0 /\ 74 51 2 10 11 13.3 Binary Trie insertion routine. Assume that the Trie class has a root pointer named “root” and a member named “level” to tell how many bits are in the key. void Trie::insert(int value) { TrieNode* temp = root; int currlev = level; if (root == NULL) root = new TrieNode(value); else while (TRUE) { if (temp->isLeaf()) { // Push down existing value int tempval = temp->value;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online