一.介绍 1.算法的时间和空间间复杂度 2.特点 Running time is insensitive to input. The process of finding the smallest item on onepass through the array does not give much information about where the smallest itemmight be on the next pass. This property can be disadvant…
Bubble sort Basic Method: import random nums = [random.randint(1,20) for _ in range(10)] #制作一个无序数字列表 print(nums) length = len(nums) for i in range(length - 1): for j in range(length - 1 - i): if nums[j] > nums[j + 1]: nums[j], nums[j + 1] = nums[j +…