Beispiel #1
0
        public PlugableBinaryTrie <int> GetTrie(NodeContainerType t, int?initialSize = null)
        {
            var size = initialSize ?? 90000;

            if (t == NodeContainerType.ArrayBacked)
            {
                container = new ArrayBackedNodesContainer <int>(size);
            }
            else if (t == NodeContainerType.MemoryMappedBacked)
            {
                container = new MemoryMappedNodeContainer <int>("./gtrie.bin", size);
            }
            else if (t == NodeContainerType.GrowableArrayBacked)
            {
                container = new GrowableArrayBackedNodeContainer <int>(100);
            }
            else
            {
                container = new GrowableMemoryMappedNodeContainer <int>("./gtrie", "t{0}.bin", 100);
            }

            trie = new PlugableBinaryTrie <int>(container);

            return(trie);
        }
Beispiel #2
0
 public TreeListNodeCollection(INodesContainer parent)
 {
     _parent = parent;
     _list   = new ArrayList();
 }
 public PlugableBinaryTrie(INodesContainer <T> container)
 {
     _nodes = container ?? throw new ArgumentNullException(nameof(container));
     _nodes.InitFirstNode();
 }