当前位置:网站首页>H指数问题
H指数问题
2022-06-22 03:29:00 【想飞的yu】
H指数
题干:
给定一位研究者论文被引用次数的数组(被引用次数是非负整数)。编写一个方法,计算出研究者的 h 指数。
h 指数的定义:h 代表“高引用次数”(high citations),一名科研人员的 h 指数是指他(她)的 (N 篇论文中)总共有 h 篇论文分别被引用了至少 h 次。且其余的 N - h 篇论文每篇被引用次数 不超过 h 次。
例如:某人的 h 指数是 20,这表示他已发表的论文中,每篇被引用了至少 20 次的论文总共有 20 篇。
题解:
class Solution {
public int hIndex(int[] citations) {
int length = citations.length;
for(int i=length;i>0;i--){
int k=0;
for(int j = 0;j<length;j++){
if(citations[j]>=i){
k++;
}
if(k>=i){
return k;
}
}
}
return 0;
}
}
这里用的是一个简单粗暴的方法,直接双层for循环套用,外层for循环由大到小,一旦找到大于i的直接返回。
边栏推荐
- 泛微 E-cology V9 信息泄露漏洞
- Golang standard library time
- Based on logback XML to realize the insensitive operation of saving log information
- 【NVMe2.0b 11】NVMe Reset
- 76. minimum covering substring sliding window method
- (问题解决) 缺少gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
- 简单入门到彻底搞懂防抖和节流
- [nvme2.0b 8] nvme queue arbitration mechanism
- Simple introduction to thoroughly understand anti shake and throttling
- 倍福TwinCAT3中PLC程序变量定义和硬件IO关联
猜你喜欢
随机推荐
Operating instructions for tcp202 current probe of Tektronix oscilloscope
DM达梦数据的关键字与表的字段冲突的解决办法
Nepal graph learning Chapter 2_ A bug before version v2.6.1 caused OOM
vim 从嫌弃到依赖(18)——查找模式进阶
Nebula Graph学习篇2_版本v2.6.1之前的bug导致OOM
3000元投影仪对比评测,当贝D3X完胜极米NEW Z6 X
TX2 attaching SD card, jtop
3DE save to Favorites
How did we solve the realsense color bias problem?
TX2 mirror source settings
NXP imx8mp learning records
调度功能:splunk-operator-controller-manager
Scheduling function: Splunk operator Controller Manager
(问题解决) 缺少gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
Are you a technology manager or a project manager?
618来袭,当贝X3和极米H3S怎么选?带你全方位深度解析
3de 新建仿真状态
Introduction and use of kubernetes
所有项目的资源
3de从设计中恢复







![[nvme2.0b 9] controller initialization process](/img/70/536b2c850c611d5d0c013586d4c2d5.png)

