Many people say that the algorithm is the core of the program, and the quality of the algorithm determines the quality of the program. As a junior PHPer, although I have little exposure to algorithmic things. However, you should still master the basic sorting algorithm. It is an essential tool for program development. Here we introduce the four basic algorithms of bubble sort, insertion sort, selection sort, and quick sort, and analyze the ideas of the algorithm.
Premise: Use bubble sort, quick sort, selection sort, and insertion sort to sort the values in the array below in order from small to large.
$arr(1,43,54,62,21,66,32,78,36,76,39);
You can do it as a question and see if you can do it. Ignore it if you are experienced, but you can give it a try if you are new to it. If you can't do it, you can take a look at the answer. If you can do it, you can take a look to see if the problem-solving ideas are consistent. Or if you have more ideas and ideas, please leave a message.
http://www.liaoxiansheng.cn/?p=427