> A semi-common beginning programmer's exercise is to write a program that numbers the lines in a text file.
In term of RAM this can be done an arbitrarily small buffer in the sense that this can be done by reading the file byte by byte. I.e. O(1).
Edit: For all practical purposes the line counter is also constant space.