摘要: #__author__=lx#__date__=2011-09-29#__brief__=Heap_sortdef left( i ): return 2*idef right( i ): return 2*i + 1def swap( a1, a2 ): return a2, a1def max_heap( A, i ): if i == 0: return l = left( i ) r = right( i ) largest = i if l <... 阅读全文
posted @ 2011-09-29 18:51 lxgeek 阅读(141) 评论(0) 推荐(0)