Current location - Health Preservation Learning Network - Healthy weight loss - What is the practical significance of monkey sorting?
What is the practical significance of monkey sorting?
This algorithm breaks through the limitation that the optimal time complexity of sorting algorithm can only be O(NlogN), but it is unrealistic in practical application.

This sort is called the most primitive and inefficient sort algorithm, because it may make you never get the result. Therefore, it is not used for practice, but for everyone's entertainment!

Principle: there is a group of unsorted data and the same number of squares, and then the data are randomly taken out in turn and randomly placed in the squares until the squares are full.

It's also called monkey sorting, I guess. This random feature is described by monkeys. After all, monkeys don't know the size of numbers, so the selection and placement of data by monkeys must be random!

This is also sorting? But in fact, we can still achieve the sorting effect we want, although the probability is very small (when there are more data). Since it can solve the problem, it is understandable to be called a method.

The meaning of sorting algorithm:

Sorting is the operation of arranging a series of records in ascending or descending order according to the size of one or some keywords. Sorting algorithm is how to arrange records according to requirements.

Sorting algorithm has received considerable attention in many fields, especially when dealing with a large number of data. An excellent algorithm can save a lot of resources. Considering the limitations and specifications of data in various fields, a lot of reasoning and analysis are needed to get an excellent algorithm that conforms to reality.