www.boyet.com | |||||||
|
Tomes of Delphi: This page describes the errata for Chapter 3 of Tomes of Delphi: Algorithms and Data Structures (DADS). Errata for Chapter 3: Linked Lists, Stacks, and Queues 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); end; Thanks to Dr. Erich Schreiner. |