PART 5
Challenging Difficult Problems
Putting Randomness into your Logic
Here are some of many reasons to include randomness in the logic of your
algorithm:
»
It makes algorithms work better and provide smarter solutions.
»
It requires fewer resources, in terms of memory and computations.
»
It creates algorithms that have a distributed output with little or no
supervision.
In the next chapter, which is dedicated to local search, you see how randomization
and probability can prove helpful when it’s difficult to determine what direction
your algorithm should take. The examples in the sections that follow demonstrate
how randomization helps to quickly find values in a certain position in your data
input and how relying on randomness can speed up sorting.
Do'stlaringiz bilan baham: |