那些日子里

记录生活的点滴

Archive for the ‘算法’ Category

线性时间排序

without comments

前面说的算法都是基于输入元素的比较,即所谓的比较排序。而任意一个比较排序算法在最坏情况下,都需要做Ω(nlgn) 次的比较。因此堆排序和合并排序都是渐进最优的比较排序算法。具体证明用到决策树模型。参见这里

本文讨论的则是三种以线性时间运行的非比较排序算法:计数排序、基数排序和桶排序。

Read the rest of this entry »

Written by huotuotuofly

四月 10th, 2011 at 7:27 上午

Posted in 算法

排序算法整理(三)

without comments

Written by huotuotuofly

四月 9th, 2011 at 6:44 上午

Posted in 算法

排序算法整理(二)

without comments

Written by huotuotuofly

四月 8th, 2011 at 10:05 下午

Posted in 算法

排序算法整理(一)

without comments

最近面试遇到好多关于排序算法的题目。算法没系统的学过,只在数据结构中有一点点涉及。就趁这机会复习下排序算法。

Read the rest of this entry »

Written by huotuotuofly

四月 8th, 2011 at 10:54 上午

Posted in 算法