예제 #1
0
 public void insert(int[] nums)
 {
     foreach (int num in nums)
     {
         Node421 curr = this.root;
         for (int i = 31; i >= 0; i--)
         {
             int currBit = (num >> i) & 1;
             if (!curr.children.ContainsKey(currBit))
             {
                 curr.children.Add(currBit, new Node421());
             }
             curr = curr.children[currBit];
         }
     }
 }
예제 #2
0
 public Trie421()
 {
     this.root = new Node421();
 }