项目作者: manosriram

项目描述 :
Implementation of Radix-Tree in C++.
高级语言: C++
项目地址: git://github.com/manosriram/Radix-Tree.git
创建时间: 2019-10-08T09:05:55Z
项目社区:https://github.com/manosriram/Radix-Tree

开源协议:GNU General Public License v3.0

下载


Implementation of Radix-Tree

Radix Tree

Usage

  1. Insert(word, node); // Insert a word into node. (RadixNode *)
  2. isLeafNode(node); // Check if Node is Lead or Not. (Boolean)
  3. Traverse(node); // Traverse the Tree starting from node. (Void)
  4. Find(node, word); // Search for a word in the Tree. (Boolean)

Example

  1. #include "Radix.hpp"
  2. using namespace RAX;
  3. int main() {
  4. RadixNode *root = new RadixNode();
  5. Insert("romane", root);
  6. Insert("romanus", root);
  7. Insert("romulus", root);
  8. Insert("rubens", root);
  9. Insert("ruber", root);
  10. Insert("rubicon", root);
  11. Insert("rubicundus", root);
  12. Traverse(root);
  13. cout << Find(root, "ruber") << endl;
  14. }

Output

  1. romane
  2. romanus
  3. romulus
  4. rubens
  5. ruber
  6. rubicon
  7. rubicundus
  8. 1