随笔分类 -  排序

摘要:题目:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.Accordi... 阅读全文
posted @ 2015-11-08 19:13 lasclocker 阅读(164) 评论(0) 推荐(0)
摘要:算法分析:序列 S= {S0, S1, S2, ...,Sn-1}是n个可排序的序列。(1). i从n-1递减到1,重复步骤(2)~(3)。(2). j从0递增到i-1,重复步骤(3)。(3). 若Sj > Sj+1,交换它们。原始代码和改进的代码如下:import java.util.Arrays... 阅读全文
posted @ 2015-10-09 21:21 lasclocker 阅读(187) 评论(0) 推荐(0)
摘要:算法过程:序列S = {S0, S1, S2, ..., Sn-1}是n个可排序的序列,则(1). 令i从1递增到n-1,重复步骤(2)-(5).(2). 将元素Si保存到临时变量tmp,令j = i-1.(3). 确定使条件tmp = 0.(4). 在(3)的过程中依次将子序列{Sj,...,Si... 阅读全文
posted @ 2015-10-08 20:26 lasclocker 阅读(293) 评论(0) 推荐(0)