摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 阅读全文
posted @ 2017-05-20 02:42 CodesKiller 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 算法原理 桶排序 (Bucket sort)或所谓的箱排序的原理是将数组分到有限数量的桶子里,然后对每个桶子再分别排序(有可能再使用别的排序算法或是以递归方式继续使用桶排序进行排序),最后将各个桶中的数据有序的合并起来。 排序过程: Data Structure Visualizations 提供了 阅读全文
posted @ 2017-05-20 01:59 CodesKiller 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文
posted @ 2017-05-20 00:56 CodesKiller 阅读(113) 评论(0) 推荐(0) 编辑