The time cost of a method is more formally called the complexity of an algorithm .
Complexity is expressed in terms of the size of the problem, which is usually notated n .
For instance, in analyzing the text of Hamlet, n is the number of words in the data file. In contrast, running the hash-table version takes only linear time, because each of the n steps takes constant time. The Unix sort program sorts its input. However, sort treats each line as a string, not a number, so 101 will come before 11. However, the number ends at the first dot, so it doesn't really sort the entries as you might like.