// Los tres casos del borrado, cada uno sobre el mismo árbol.
#include <iostream>

#include "bst_set.h"

namespace {

void show_erase(int key) {
    BstSet<int> tree;
    for (int value : {50, 30, 70, 20, 40, 60, 80, 35, 65, 90}) {
        tree.insert(value);
    }
    std::cout << "borrar " << key << ": " << tree.shape() << "\n";
    tree.erase(key);
    tree.check_invariants();
    std::cout << "queda:    " << tree.shape() << "\n";
}

}  // namespace

int main() {
    show_erase(20);
    show_erase(80);
    show_erase(60);
    show_erase(30);
    show_erase(50);
    show_erase(70);
    return 0;
}
