View Single Post
  #2 (permalink)  
Old 11-23-2007, 11:09 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is online now
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,238
Last Blog:
wxWidgets is NOT code ...
Credits: 2,668
Rep Power: 36
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default

Basically, in the destructor you need to check both left and right children for NULL, and if not NULL then tell them to delete (which will result in a recursive cascade of freed nodes).
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Reply With Quote