Exemplo n.º 1
0
        public void Add(T[] array, int index, V value)
        {
            if (array.Length == index)
            {
                this.value = value;
                return;
            }

            if (!subtrees.TryGetValue(array[index], out ArrayTree <T, V> tree))
            {
                tree = new ArrayTree <T, V>(this, depth + 1);
                subtrees.Add(array[index], tree);
            }

            tree.Add(array, index + 1, value);
        }
Exemplo n.º 2
0
 private ArrayTree(ArrayTree <T, V> parent, int depth)
 {
     subtrees    = new Dictionary <T, ArrayTree <T, V> >();
     this.parent = parent;
     this.depth  = depth;
 }