ToDADS errata: Chapter 3: Linked Lists, Stacks, and Queues

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

1. Page 73. The code in the Create constructor makes use of a named constant called PageSize. As the text states, this constant is set to 1024. However, a couple of lines further on I use the value 1024 explicitly instead of using this named constant. The code should look like:

	{calculate the page size (default 1024 bytes) and the number of
	nodes per page; if the default page size is not large enough for
	two or more nodes, force a single node per page}
	FNodesPerPage := (PageSize - sizeof(pointer)) div aNodeSize;
	if (FNodesPerPage > 1) then
	  FPageSize := PageSize
	else begin
	  FNodesPerPage := 1;
	  FPagesize := aNodeSize + sizeof(pointer);

Thanks to Dr. Erich Schreiner.