Re: Non-recursive chop and clone for Binary Search Tree - Solutions



On Nov 23, 6:14 pm, Ben Pfaff <b...@xxxxxxxxxxxxxxx> wrote:
"jehugalea...@xxxxxxxxx" <jehugalea...@xxxxxxxxx> writes:
At the time, I wasn't in the mood; however, I was recently REQUIRED to
figure it out. The problem: I had an unbalanced tree that needed
destroyed. You can usually get away with a recursive (naive/trivial)
implementation, but you're leaving yourself open for a stack overflow
at some point down the line.

There's no need to use level order for that. I would do it like
this:http://adtinfo.org/libavl.html/Destroying-a-BST-by-Rotation.html
--
"Mon peu de succès près des femmes est toujours venu de les trop aimer.."
--Jean-Jacques Rousseau

Right . . . it does everything on the way down using a form of stack.
By-level is simply to destroy from the bottom up.
.



Relevant Pages

  • Y&R The shinola has hit the fan
    ... I've also read that Eileen Davidson was leaving. ... of catfights and a love hate relationship. ... I guess if you can't create a great soap the next best thing is to destroy one. ...
    (rec.arts.tv.soaps.cbs)
  • Re: Textbook in time
    ... Fearmongering opportunists in the government can destroy ... my nation, leaving behind a geopolitical entity with its name and ...
    (rec.arts.sf.written)
  • Re: I give up, Im leaving the NG forever!
    ... > stubborn to destroy. ... I'm leaving this NG for good. ... Prev by Date: ...
    (misc.fitness.weights)
  • Re: ActiveX Control Crashes - VB6
    ... "I'm leaving now, would you like me to close the door on ... ...or destroy the house as I go?" ...
    (microsoft.public.vb.general.discussion)
  • Re: Florescent vs. incandescent fading
    ... or maybe it is more correct to say they will destroy the other colors ... leaving only the greenish tint. ... for a nice diagram. ...
    (alt.photography)