implemented new working destructor for tree
authorChris Koeritz <fred@gruntose.com>
Sun, 3 Oct 2021 15:23:53 +0000 (11:23 -0400)
committerChris Koeritz <fred@gruntose.com>
Sun, 3 Oct 2021 15:23:53 +0000 (11:23 -0400)
got tired of the wayback machine corrupting our nodes, so implemented a more elegant stack based solution.  still iterative, but can have some weight in stack.  preference is depth first; we add all the branches of current node (in reverse order) to stack, then start chewing on nodes in stack, where each node we pull out gets its kids added in reverse order and then node itself is eliminated.  reverse order addition means preserved order on popping (first comes out first).  adding kids to stack means that we should start processing first kid, then its first kid, then its first kid and so on.  basically same order as previous algorithm, but without bizarre double whack problems.


No differences found