News for hackers. Stuff that matters.
Re:look(1): lines beginning with given string by DougMerritt on Saturday December 12, 2015 @09:55PM (#10725216)
'look' can stop working when it finishes the sorted section of 'dog', whereas grep must continue to the end of the file.

Ignoring memory hierarchy, naturally 'look' would be O(log n) while grep would be O(n).

Special input (sorted in this case) of course often calls for matching algorithms, when speed matters.

There are no comments on this comment yet.