Created
September 8, 2023 17:26
-
-
Save YK-Unit/2f462c746de48b6813c06b457a20d6ab to your computer and use it in GitHub Desktop.
这是一个冒泡排序算法的 Python 实现。它通过多次遍历列表,比较每对相邻元素,如果它们的顺序错误,就将它们交换过来。遍历列表直到没有需要交换的元素,这意味着该列表已经排序完成。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 实现冒泡排序 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment