Unverified Commit d6240ff6 authored by ir1d's avatar ir1d Committed by GitHub
Browse files

Update llrbt.md

parent 57611a1f
Loading
Loading
Loading
Loading
+47 −57
Original line number Diff line number Diff line
@@ -76,11 +76,11 @@
    }
    ```

    template<class Key, class Compare>
    typename Set<Key, Compare>::Node_Set<Key, Compare>::insert(Set::Node_root, const Key &key) const {if (root == nullptr)
    template<class Key, class Compare>
    typename Set<Key, Compare>::Node_Set<Key, Compare>::insert(Set::Node_root, const Key &key) const {if (root == nullptr)
        return new Node(key, kRed, 1);
      if (root->key == key);
      else if (cmp\_(key, root->key))//if (key &lt; root->key)
      else if (cmp\_(key, root->key))//if (key < root->key)
        root->lc = insert(root->lc, key);
      else
        root->rc = insert(root->rc, key);
@@ -203,7 +203,6 @@
    template <class Key, class Compare = std::less<Key>>
    class Set {
     private:
    ```
     
      enum NodeColor {
        kBlack = 0, kRed = 1
@@ -280,23 +279,14 @@
      }
     
      Node *insert(Node *root, const Key &key) const;

      Node *delete_arbitrary(Node *root, Key key) const;

      Node *delete_min(Node *root) const;

      Node *move_red_right(Node *root) const;

      Node *move_red_left(Node *root) const;

      Node *fix_up(Node *root) const;

      const Key &get_min(Node *root) const;

      void serialize(Node *root, std::vector<Key> *) const;

      void print_tree(Set::Node *root, int indent) const;

      Compare cmp_ = Compare();
      Node *root_{nullptr};