| 12-27-2009, 07:53 PM | #1 |
What does this mean and how does it relate to the speed of system? How do you calculate it too? I looked at a wiki on it and I understood none of it. ![]() |
| 12-27-2009, 08:17 PM | #2 |
That represents a time complexity of an algorithm. It describes how well the algorithm scales with the task. For example, a sorting algorithm is used to sort a list of values. As the list grows longer, the time the algorithm requires to sort the list also increases. The time complexity defines how quickly this time increases in relation to the length of the list. O(n) means linear complexity: that means that if you double the list size, the algorithm will require double the time to process it. O(n*n) means that doubling the size of the list will quadruple the processing time. In general, lower time complexity is better. However, for specific applications, that may not always be the case. The time complexity only specifies how well does the algorithm scale with the size of its input data, not the actual speed of the algorithm. Therefore, an algorithm with a lower time complexity will always outperform an algorithm with a higher one if the input data is large enough, however for small data sets the "worse" algorithm may be faster. |
