ToDADS errata: Chapter 8: Binary Trees

published: Tue, 17-Jun-2003   |   updated: Sat, 20-Aug-2016
Image of Julian's book

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.