Possible Duplicate:
Plain English explanation of Big O
In the answer to a programming puzzle it said sorting a string takes O(n log n) time. How is that derived?
Does anybody have a good reference link for Big O resources.
Thanks
Possible Duplicate:
Plain English explanation of Big O
In the answer to a programming puzzle it said sorting a string takes O(n log n) time. How is that derived?
Does anybody have a good reference link for Big O resources.
Thanks
Why is sorting a string O(n log n)?
Sorting the characters in a string is not necessarily O(n log n).
A definition and some examples of Big O can be found by using a search engine, e.g. here:
An explanation of sort algorithms based on comparing elements, together with an explanation for the lower bound on the number of required comparisons, can be found here: