Unlike .match(), the
.find() method returns not a child
but a generator that visits all children at or after a
given key value.
# - - - S k i p L i s t . f i n d - - -
def find ( self, key ):
"""Return an iterator starting at a given position
"""
As with the .match() method (see
Section 4.23, “SkipList.find()”), the first step is to find the
level-0 predecessor of the desired position. See
Section 4.22, “”.
SkipList.__searchCutItem
#-- 1 --
# [ searchItem := search-point ( 0, key ).links[0] ]
prevItem = self.__searchCutItem ( key )
searchItem = prevItem.links[0]
At this point, all we need to do is to pass the selected
_SkipItem to the _SkipListIterator constructor, and return the new
iterator to the caller. See Section 4.4, “The _SkipListIterator class”.
#-- 2 --
return _SkipListIterator ( searchItem )