Skip to content

Instantly share code, notes, and snippets.

@YK-Unit
Created September 8, 2023 17:26
Show Gist options
  • Save YK-Unit/2f462c746de48b6813c06b457a20d6ab to your computer and use it in GitHub Desktop.
Save YK-Unit/2f462c746de48b6813c06b457a20d6ab to your computer and use it in GitHub Desktop.
这是一个冒泡排序算法的 Python 实现。它通过多次遍历列表,比较每对相邻元素,如果它们的顺序错误,就将它们交换过来。遍历列表直到没有需要交换的元素,这意味着该列表已经排序完成。
Python 实现冒泡排序
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment