Retrieving the traversed range

Manfred_Nowak svv1999 at hotmail.com
Sat Aug 28 04:03:24 PDT 2010


Andrei Alexandrescu wrote:

>> Thx, but then I am missing the whole point of this thread.
> It's simple: the OP wanted this:
> - start with a bidir range r
> - move from the LEFT in it for a while
    (prefix, postfix)= inPlaceSplit( r, predicate, Move.RIGHT)
      // == O(prefix.len)
> - then reverse whatever is to the LEFT of the walking point
    retro( prefix)
      // == O(1)

Please note:
even if the runtime of `retro' would be Theta(n) the runtime would still be 
limited by O(prefix.len)
-manfred




More information about the Digitalmars-d mailing list