コード例 #1
0
ファイル: GuideNode.java プロジェクト: pjliu/Meeshquest
  protected void insertKid(Node<K, V> old, K key, Node<K, V> left, Node<K, V> right) {
    int ind = kids.indexOf(old);
    if (ind < 0) {
      // when the root splits, the two new nodes are added to the dummy
      // new root
      kids.add(left);
      kids.add(right);
      guides.add(key);
      return;
    }

    kids.set(ind, left);
    kids.add(ind + 1, right);
    guides.add(ind, key);

    if (isOverFull()) {
      split();
    }
  }