Re: Non-recursive chop and clone for Binary Search Tree - Solutions
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Fri, 23 Nov 2007 17:14:39 -0800
"jehugaleahsa@xxxxxxxxx" <jehugaleahsa@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
.
- Follow-Ups:
- Re: Non-recursive chop and clone for Binary Search Tree - Solutions
- From: moi
- Re: Non-recursive chop and clone for Binary Search Tree - Solutions
- From: jehugaleahsa@xxxxxxxxx
- Re: Non-recursive chop and clone for Binary Search Tree - Solutions
- References:
- Non-recursive chop and clone for Binary Search Tree - Solutions
- From: jehugaleahsa@xxxxxxxxx
- Non-recursive chop and clone for Binary Search Tree - Solutions
- Prev by Date: Re: In-place list manipulation
- Next by Date: Re: Project report requirements
- Previous by thread: Non-recursive chop and clone for Binary Search Tree - Solutions
- Next by thread: Re: Non-recursive chop and clone for Binary Search Tree - Solutions
- Index(es):