Quick sort algorithm giving wrong outputs on last two elements

后端 未结 0 1242
名媛妹妹
名媛妹妹 2020-11-30 22:04
def swap(a, p, q):
    # print(\'p is: \', p)
    tmp = a[p]
    a[p] = a[q]
    a[q] = tmp
    return a


def partition(a, q):
    # if flag == 0:
    # q is the PO         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题