Java Reference
In-Depth Information
n
Milliseconds
10,000
786
20,000
2,148
30,000
4,796
40,000
9,192
50,000
13,321
60,000
19,299
Figure 1
Time Taken by Selection Sort
634
635
These measurements were obtained with a Pentium processor with a clock speed of 2
GHz, running Java 6 on the Linux operating system. On another computer the actual
numbers will look different, but the relationship between the numbers will be the
same. Figure 1 shows a plot of the measurements. As you can see, doubling the size
of the data set more than doubles the time needed to sort it.
S ELF C HECK
3. Approximately how many seconds would it take to sort a data set of
80,000 values?
Search WWH ::




Custom Search