| www.boyet.com | |||||||
|
Tomes of Delphi: This page describes the errata for Chapter 8 of Tomes of Delphi: Algorithms and Data Structures (DADS). Errata for Chapter 8: Binary Trees 1. Page 281. The code in the Delete method was nicely mangled by the typesetter, losing an end-of-line marker and an 'a'. The code on the CD is correct (as was the document I sent to the publisher). The code should look like:
{find out whether we're a left or right child of our parent}
OurType := GetChildType(aNode);
{set the child link of our parent to our child link}
aNode^.btParent^.btChild[OurType] := aNode^.btChild[OurChildsType];
if (aNode^.btChild[OurChildsType] <> nil) then
aNode^.btChild[OurChildsType]^.btParent := aNode^.btParent;
Thanks to Dr. Erich Schreiner. |
||||||