H-index
Given an array of citations (each citation was a non-negative integer) of a researcher, write a function to compute the RES Earcher ' s h-index.
According to the definition of H-index on Wikipedia: ' A scientist has index H if h of his/her N Papers has at least H citations each, and the other n−h papers has no more than H citation S each. "
For example, given citations = [3, 0, 6, 1, 5]
, which means the researcher have papers in total and each of 5
them had received 3, 0, 6, 1, 5
Citatio NS respectively. Since the researcher have papers with at least citations each and the remaining both with 3
3
no more than 3
CIT Ations each, he h-index is 3
.
Note:if there was several possible values h
for, the maximum one is taken as the h-index.
Hint:
- An easy approach are to sort the array first.
- What is the possible values of H-index?
- A faster approach is to use extra space.
https://leetcode.com/problems/h-index/
H factor, the Almighty Baidu Encyclopedia play through the solution ...
H stands for "high citation" (Hi citations), a researcher's H index refers to at most H-papers which are quoted at least H times respectively.
To determine a person's H index is very easy, to the SCI site, to find out a person published all SCI papers, let it ranked from high to low by the cited number, check down, until the number of a paper is more than the number of citations, the number minus 1 is the H index.
H-index ii:http://www.cnblogs.com/liok3187/p/4782660.html
1 /**2 * @param {number[]} citations3 * @return {number}4 */5 varHindex =function(citations) {6citations =citations.sort (sorting);7 vari = 0;8 while(i + 1 <=Citations[i]) {9i++;Ten } One returnI; A - - functionsorting (A, b) { the if(A >b) { - return-1; -}Else if(A <b) { - return1; +}Else{ - return0; + } A } at};
[Leetcode] [JavaScript] H-index