会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
colors
谦谦君子,温润如玉
博客园
首页
新随笔
联系
订阅
管理
2016年4月7日
Leetcode 23. Merge k Sorted Lists(python)
摘要: 分治法两两合并,才没有超时
阅读全文
posted @ 2016-04-07 17:44 colors
阅读(248)
评论(0)
推荐(0)
编辑
大顶堆进行升序排序的python实现
摘要: #!/usr/bin/env python # -*- coding: utf-8 -*- # 将前l个节点构成的树的第i个节点调整为大顶堆 # base 1 def heap_adjust(lists,i,l): left,right=2*i-1,2*i max=i-1 if left<l and lists[max]<lists[left]: max...
阅读全文
posted @ 2016-04-07 16:41 colors
阅读(658)
评论(0)
推荐(0)
编辑
公告