PAUL SHOULD REVIEW THIS CONTENT.
On this page, you will see how long it takes to run a linear search algorithm.
On Unit 2 Lab 3 Page 6: Solving a Word Puzzle, you built a block and used it with
keep
to find words of a specific length in a word list. But how long does a process like that take?
The computation time
block takes any reporter (with its inputs filled in), computes the result but ignores it, and instead reports how long it took to do the computation (in milliseconds).
In this example, it took 27 milliseconds to compute the list of integers from 1 to 1000. (The report you see will depend on how fast your computer is and what other programs are running on it.)
You can look inside computation time
to see how it works.
computation time
block you just used to answer the previous question three more times and note the range of answers. They're not exactly the same because of other things that your computer is doing at the same time, so you should always take whatever result it gives you as approximate.computation time
to determine how long it takes to find out how many five-letter words are in the 100,000 words list. Searching for all the five-letter words in a specific word list is an instance of a more general problem: searching for all the words of any particular length.
The only way to answer a "How many words..." problem is to check every single word in the dictionary. So if you have ten times as many words in the dictionary, it takes ten times as long to check them all.