数据结构与算法
litchi666
蓝天白云螺旋桨
展开
-
堆排序算法
L = [49,38,65,97,76,13,27,49]def swap(list, a, b): temp = list[a] list[a] = list[b] list[b] = tempdef adjust_heap(numbers, i, length): """从第i个位置开始调整使得成为最大堆""" while i < l...原创 2018-08-09 10:53:46 · 120 阅读 · 0 评论 -
322. 零钱兑换
class Solution: def coinChange(self, coins, amount): """ :type coins: List[int] :type amount: int :rtype: int """ if amount == 0: retur...原创 2018-08-14 17:55:23 · 294 阅读 · 0 评论