随笔分类 - algorithms
摘要:1 import random 2 3 def partition(A, lo, hi): 4 pivot_index = random.randint(lo, hi) 5 pivot = A[pivot_index] 6 A[pivot_index], A[hi] = ...
阅读全文
摘要:An Python implementation of heap-sortbased on the detailed algorithm description in Introduction to Algorithms Third Editionimport randomdef max_heap...
阅读全文
浙公网安备 33010602011771号