#include <basis/common_outcomes.h>
#include <basis/functions.h>
#include <basis/guards.h>
#include <basis/common_outcomes.h>
#include <basis/functions.h>
#include <basis/guards.h>
// must at least unhook ourselves from the parent so we don't become a lost
// cousin.
tree *my_parent = parent();
// must at least unhook ourselves from the parent so we don't become a lost
// cousin.
tree *my_parent = parent();
//original version suffers from being too recursive on windoze,
//which blows out the stack. linux never showed this problem. so, i
//original version suffers from being too recursive on windoze,
//which blows out the stack. linux never showed this problem. so, i
// newer version of delete doesn't recurse; it just iterates instead,
// which avoids the massive recursive depth of the original approach.
tree *curr_node = this;
// newer version of delete doesn't recurse; it just iterates instead,
// which avoids the massive recursive depth of the original approach.
tree *curr_node = this;
while (curr_node != NULL_POINTER) {
// make a breadcrumb for getting back to 'here' in the tree.
tree *way_back = curr_node;
while (curr_node != NULL_POINTER) {
// make a breadcrumb for getting back to 'here' in the tree.
tree *way_back = curr_node;
// wayback has no children, so we can take action.
// if wayback is the same as "this", then we exit from iterations since
// wayback has no children, so we can take action.
// if wayback is the same as "this", then we exit from iterations since
// our remit, since wayback is not the same node as the top level one
// in the destructor (as long as there are no cycles in the tree...).
curr_node = way_back->parent(); // go up in tree on next iteration.
// our remit, since wayback is not the same node as the top level one
// in the destructor (as long as there are no cycles in the tree...).
curr_node = way_back->parent(); // go up in tree on next iteration.