- 4
- 0
- 约1.05万字
- 约 12页
- 2019-06-11 发布于广东
- 举报
Analysis of three common sorting algorithms in C language
One, bubble method (foaming method)
Algorithm requirements: use the bubble method to sort 10 integers in ascending order?
Algorithm analysis: if there are n numbers, n-1 times are compared? In the first comparison, n-1 times 22 of the adjacent elements are compared, and in the j comparison, n-j times 22 are compared? Comparison of the sequence from front to back, after a comparison, the bottom value (change to the last element position), the maximum sink to ascending, minimum bottom is descending.
Algorithm source code:
# inelude stdio
原创力文档

文档评论(0)