|
Share this post! |
| Vote this! |
|
In computer science, often the question is not how to solve a problem,
but how to solve a problem well. For instance, take the
problem of sorting.
Many sorting algorithms are well-known; the problem is not to
find a
way to sort words, but to find a way to efficiently sort
words. This
article is about understanding how to compare the relative
efficiency
of algorithms and why it's important to do so, using a concept
called big-O notation to define the efficiency of an algorithm.
Why Brute Force is not Efficient Enough
If it's possible to solve a problem by using a brute force technique,
such as trying out all possible combinations of solutions (for instance,
sorting a group of words by trying all possible orderings until you
find one that is in order), then why is it necessary to find a better
approach? The simplest answer is, if you had a fast enough computer,
maybe it wouldn't be. But as it stands, we do not have access to computers
fast enough. For instance, if you were to try out all possible orderings
of 100 words, that would require 100! (100 factorial) orders of words.
(
Explanation)
That's a number with a 158 digits;
more...
Highly
Recommended Reading After Above
Data Structures
0 comments:
Post a Comment