摘要:
``` def ReOrderOddEven(li): '''思路:1.如果low索引元素为奇数就+1.知道找到为偶数的下标;2.如果high为偶数 就-1 直到找到基数的下标3,交换的条件是:左边为偶数,右边为基数''' low = 0 high = len(li) - 1 while low < high: if li[low] % 2 == 0 and li[high] % 2 == 1: 阅读全文
posted @ 2020-04-26 11:28
烧刘病
阅读(101)
评论(0)
推荐(0)

浙公网安备 33010602011771号