🎄T
some_var = nullptr;
}
Size: a a a
🎄T
ᅠᅠ
Х
🎄T
T
ᅠᅠ
tb
🎄T
К
🎄T
binary_tree* add(T data) {
binary_tree* cur = this;
while (cur) {
if (data < cur->data) {
if (cur->left) {
cur = cur->left;
std::cout << "Left" << std::ends;
continue;
}
else {
cur->left = new binary_tree<int>(data);
std::cout << "in Left " << data << std::endl;
break;
}
}
else if (data > cur->data) {
if (cur->right) {
cur = cur->right;
std::cout << "Right" << std::ends;
continue;
}
else {
cur->right = new binary_tree<int>(data);
std::cout << "in Right " << data << std::endl;
break;
}
}
}
return this;
}К
К
🎄T
К
🎄T
К
🎄T
🎄T