Soups

Starting at the Right Place

A more complicated approach involves starting your search at a more precise point. This is accomplished by skipping as many entries as possible using a beginKey. By using a beginKey, some of the leaf nodes at the left of the tree can be missed altogether (see FIGURE 9.5). The beginKey is used to skip rapidly through nodes in the tree to the desired beginning node. This is where the saving ends, however, because all nodes from there to the end of the tree must be visited.

FIGURE 9.5 : Entries visited when using a beginKey.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996