Skip to main content

H-Index这道题题目都看不懂


https://zh.wikipedia.org/wiki/H%E6%8C%87%E6%95%B0

H指数的计算基于其研究者的论文数量及其论文被引用的次数。赫希认为:一个人在其所有学术文章中有N篇论文分别被引用了至少N次,他的H指数就是N。[1][2]美国耶鲁大学免疫学家理查德·弗来沃发表的900篇文章中,有107篇被引用了107次以上,他的H指数是107。
可以按照如下方法确定某人的H指数:
  1. 将其发表的所有SCI论文按被引次数从高到低排序;
  2. 从前往后查找排序后的列表,直到某篇论文的序号大于该论文被引次数。所得序号减一即为H指数。
发信人: DreamChaser0 (光辉岁月), 信区: JobHunting
标  题: Re: H-Index这道题题目都看不懂
发信站: BBS 未名空间站 (Sat Aug 19 02:27:57 2017, 美东)

叔我来了。
这道题的意思就是问
数组里面 有几个 大于等 "几" 的数。
[3, 0, 6, 1, 5]
比如说例子里, 就有3个 大于等于 3 的数

降序排列比较好懂
nums = [6, 5, 3, 1, 0]
index = [1, 2, 3, 4, 5]

有没有1个数  >= 1大啊? 有 [6]
有没有2个数 >= 2 啊?有 [6, 5]
有没有3个数 >= 3啊?有 [6, 5 ,3]
有没有4个数 >= 4啊?没 只有2个[6, 5]
所以返回3.



class Solution {
    public int hIndex(int[] citations) {
        Arrays.sort(citations);
        int i = 0;
        int n = citations.length;
        for (; i < n; i++) {
            if (citations[n - 1 - i] >= i + 1) {
                continue;
            } else {
                break;
            }
        }
        return i;
    }
}

Comments

Popular posts from this blog

CKA Simulator Kubernetes 1.22

  https://killer.sh Pre Setup Once you've gained access to your terminal it might be wise to spend ~1 minute to setup your environment. You could set these: alias k = kubectl                         # will already be pre-configured export do = "--dry-run=client -o yaml"     # k get pod x $do export now = "--force --grace-period 0"   # k delete pod x $now Vim To make vim use 2 spaces for a tab edit ~/.vimrc to contain: set tabstop=2 set expandtab set shiftwidth=2 More setup suggestions are in the tips section .     Question 1 | Contexts Task weight: 1%   You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl . Finally write a second command doing the same thing into ...

OWASP Top 10 Threats and Mitigations Exam - Single Select

Last updated 4 Aug 11 Course Title: OWASP Top 10 Threats and Mitigation Exam Questions - Single Select 1) Which of the following consequences is most likely to occur due to an injection attack? Spoofing Cross-site request forgery Denial of service   Correct Insecure direct object references 2) Your application is created using a language that does not support a clear distinction between code and data. Which vulnerability is most likely to occur in your application? Injection   Correct Insecure direct object references Failure to restrict URL access Insufficient transport layer protection 3) Which of the following scenarios is most likely to cause an injection attack? Unvalidated input is embedded in an instruction stream.   Correct Unvalidated input can be distinguished from valid instructions. A Web application does not validate a client’s access to a resource. A Web action performs an operation on behalf of the user without checkin...